Hi
Sublime Merge is great.
However, the diff behaves a bit different than git diff
when using non-utf8 files.
Without any .gitattributes and files in windows-1252 encoding:
- git diff shows Markers like
<FC>
for ü on both sides of the diff, if lines containing non-utf8 characters are changed - Sublime Merge shows the non-utf8 chars like they are displayed in Sublime Text if encoding is set to Windows 1252
When i add ‘*.c text working-tree-encoding=windows-1252’ to .gitattributes, and do a git add --renormalize .
and a commit then the following happens in all further changes:
- git diff shows diffs in the correct encoding, showing ü instead of
<FC>
- When the file is unstaged, Sublime merge shows a ‘gray’ (no red/green, but a stageable hunk) change on every occurence of any non-utf8 character in the file.
- When the file is staged, Sublime merge shows only the diff of the actually changed lines.
If I stage one of those gray hunks via Sublime Merge, the following happens:
- I thing some utf-8 version is staged??
- All occourences of non-utf8 characters that have been gray in the diff are now red/green with a change from ü to ü.
- The staged hunk is now gray
-
git diff
shows- <FC>
+ ü
-
git diff --staged
shows- ü
+ <FC>
- But
git diff
only shows the origially changed line and the staged hunk, but none of the other hunks that Sublime Merge shows.
Thanks for fixing
Daniel