You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The colors in the diff are either not showing up, or are completely wrong / misleading.
Repro steps:
git config --bool --global diff-so-fancy.markEmptyLines true
cd $(mktemp -d)
git init
git commit --allow-empty -m "Initial commit"
echo -en "----\n\n----\n" > file
git add file; git commit -m "Add file"
# Shows empty lines properly
git show
# But then shows two lines deleted here
echo -en "----\n \n----\n" > file
git diff
git add file
# Then, after removing one space, it looks as if 3 spaces were removed from a line below a blank one
echo -en "----\n \n----\n" > file
git diff
git add file
# Then, after removing all of the whitespace, it now looks as if a blank line was added,
# and the file now contains 2 blank lines, where in reality it contains 1
echo -en "----\n\n----\n" > file
git diff
This makes removing redundant whitespace from blank lines, common in older Python codebases, painful.
The text was updated successfully, but these errors were encountered:
Not sure if it's a different issue or not, but my case is:
a.sh
# rm -rf b
mkdir b
cd b
git init
# create a file with a space on a second lineecho'ab'> f
git add f
git commit -m a
# remove the spaceecho'ab'> f
sed -Ei 's/ //' f
git diff
$ sh -eu a.sh
The way it looks like with diff-so-fancy:
Without:
markEmptyLines doesn't affect it.
I'd say it looks like a line was added, instead of a line was stripped of spaces.
The colors in the diff are either not showing up, or are completely wrong / misleading.
Repro steps:
This makes removing redundant whitespace from blank lines, common in older Python codebases, painful.
The text was updated successfully, but these errors were encountered: