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

VS2022, GitDiffMargin indicator wrongly shows a change, but VS2022 diff margin correctly shows an addition. #775

Open
TheGreatUnboxing opened this issue Apr 19, 2024 · 2 comments
Labels

Comments

@TheGreatUnboxing
Copy link

TheGreatUnboxing commented Apr 19, 2024

Versions

  • Git Diff Margin version: 3.12.1
  • Visual Studio version: Visual Studio Community 2022 (64-bit) - Current Version 17.9.6 (on Windows 10)

What happened

Have been using git diff margin exclusively for years, however it has often shown changes when there are additions. I thought this might be because of the current diff algorythm being used, so in bash I entered this to make sure:

git config --global diff.algorithm patience

Nothing changed upon restart, however Sublime Merge does show (correctly) an addition of a block of c# code where Git Diff Margin (incorrectly) shows it as a change.
e.g:

image

image

I'm wondering if perhaps Git Diff Margin is looking at a different Git install to the one VS is looking at? Or one looking at a 32bit install and the other a 64 bit install? However I don't know how to determine that. My last Git 64bit update installed into C:\Program Files\Git\

Expected behavior

GitDiffMargin displays the same diff margin indicators as VS 2022 track changes (Git) margin.

ed: This may not be a bug, may be a configuration issue but I can't find any settings in Tools -> Options specifically for GitDiffMargin

ed2: I ran git config --global diff.algorithm patience in both Git folders I can find:

  1. C:\Program Files\Git\bin
  2. C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw64\bin\

However the results are the same as above.

@sharwell
Copy link
Collaborator

sharwell commented May 23, 2024

For the change above, was there a whitespace change on line 1337?

Note that Git Diff Margin is showing exactly the same result as Sublime Merge here. A "change" is defined as one or more lines removed followed by one or more lines added.

@TheGreatUnboxing
Copy link
Author

TheGreatUnboxing commented May 24, 2024

For the change above, was there a whitespace change on line 1337?

No, I did check to make sure there was no whitespace on the blank line there.

Note that Git Diff Margin is showing exactly the same result as Sublime Merge here. A "change" is defined as one or more lines removed followed by one or more lines added.

True, but both seem incorrect to me, whereas VS 2022 is correct in terms of the actual changes made.

Ed: As sublime merge agrees with GDM, I was wondering if VS was looking at different diff settings, but tried changing the diff algo in Git and in SM's options, but nothing changed. Perhaps VS is doing some extra black-box magic on top but was hoping to get the same results from GDM (I prefer its margin UI for one)

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

No branches or pull requests

2 participants