when git config contains any of diff.noPrefix, diff.srcPrefix or diff.dstPrefix (e.g. set it via "git config diff.noPrefix true" or "git config diff.srcPrefix some/path/") then diff in sourcetree is displaying incorrectly
It displays the file path below a 2nd time with a green icon and on top the first hunk is broken too
Currently sourcetree runs this command for the diff
>git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks diff --unified=1 -M --no-color -- some/file.js
which seems that sourcetree already is aware of a similar issue caused by diff.mnemonicprefix
The fix is simple. Instead of just using `-c diff.mnemonicprefix=false` the command has to be changed to `-c diff.mnemonicprefix=false -c diff.noPrefix=false -c diff.srcPrefix="a/" -c diff.dstPrefix="b/"`
e.g.
>git -c diff.mnemonicprefix=false -c diff.noPrefix=false -c diff.srcPrefix="a/" -c diff.dstPrefix="b/" -c core.quotepath=false --no-optional-locks diff --unified=1 -M --no-color -- some/file.js
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.