Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose diff whitespace settings #2007

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darthkurak
Copy link

Address #1778

Comment on lines +61 to +75
if (compareOptions.WhitespaceMode != null)
{
if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreAllWhitespaces)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE;
}
else if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreWhitespaceChange)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE_CHANGE;
}
else
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE_EOL;
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought:

Suggested change
if (compareOptions.WhitespaceMode != null)
{
if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreAllWhitespaces)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE;
}
else if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreWhitespaceChange)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE_CHANGE;
}
else
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE_EOL;
}
}
if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreAllWhitespaces)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE;
}
else if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreWhitespaceChange)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE_CHANGE;
}
else if (compareOptions.WhitespaceMode == DiffWhitespaceMode.IgnoreWhitespaceEol)
{
options.Flags |= GitDiffOptionFlags.GIT_DIFF_IGNORE_WHITESPACE_EOL;
}

@darthkurak
Copy link
Author

@GrimRob can you merge this?

@GrimRob
Copy link

GrimRob commented Feb 28, 2024

@GrimRob can you merge this?

No I don't have write access

@starkpl
Copy link

starkpl commented Mar 6, 2024

@bording can we ask you to merge this? It would help a lot as we had to use a forked version for the last year.

@amis92
Copy link

amis92 commented Mar 25, 2024

There's also a similar PR from the original issue's OP: #1779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants