FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Expose diff whitespace settings by darthkurak · Pull Request #2007 · libgit2/libgit2sharp · GitHub

Expose diff whitespace settings - #2007

Open
darthkurak wants to merge 1 commit into
libgit2:masterfrom
darthkurak:feature/more-diff-settings
Open

Expose diff whitespace settings#2007
darthkurak wants to merge 1 commit into
libgit2:masterfrom
darthkurak:feature/more-diff-settings

Conversation

Copy link
Copy Markdown

Address #1778

Comment thread LibGit2Sharp/Diff.cs
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
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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;
}

Copy link
Copy Markdown
Author

@GrimRob can you merge this?

GrimRob commented Feb 28, 2024

Copy link
Copy Markdown

@GrimRob can you merge this?

No I don't have write access

starkpl commented Mar 6, 2024

Copy link
Copy Markdown

@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 commented Mar 25, 2024

Copy link
Copy Markdown

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL