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
There is a bug in git status that happens when a file changes but the filtered version of the file does not. Correctly, git diff does not show anything as different and git commit believes there is nothing to commit.
Reproducer:
$ git init
$ touch bar
$ git add bar
$ git commit -am 'Bar'
[main (root-commit) dd12b3e] Bar
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 bar
$ echo -en '\n[filter "noat"]\n clean = grep -v "@"\n' >> .git/config
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[filter "noat"]
clean = grep -v "@"
$ echo -en 'abc\n@def\nghi\n' > bar
$ cat bar
abc
@def
ghi
$ echo "* filter=noat" > .gitattributes
$ git commit -am 'No at bar'
[main e81ee3b] No at bar
2 files changed, 3 insertions(+)
create mode 100644 .gitattributes
$ git show HEAD:bar
abc
ghi
$ echo -en 'abc\n@@def\nghi\n' > bar # Add another @ to the same filtered out line. touch doesn't cause this bug
$ git status --porcelain
M bar
$ git diff # no output as there is no diff
$ git commit -am "I did not update"
On branch main
nothing to commit, working tree clean
While this reproducer is a bit contrived, the real world examples are with Jupyter notebooks filtering output, so I expect this is a somewhat common occurrence.
The text was updated successfully, but these errors were encountered:
There is a bug in git status that happens when a file changes but the filtered version of the file does not. Correctly, git diff does not show anything as different and git commit believes there is nothing to commit.
Reproducer:
While this reproducer is a bit contrived, the real world examples are with Jupyter notebooks filtering output, so I expect this is a somewhat common occurrence.
The text was updated successfully, but these errors were encountered: