diff-so-fancy icon indicating copy to clipboard operation
diff-so-fancy copied to clipboard

`mismatched output from interactive.diffFilter` when adding the existence of new files

Open llakala opened this issue 1 year ago • 3 comments

I've been testing the --patch mode for a couple of days with good results in almost all cases. The only problem I've found is when you do the following:

1. Create a new file with content

2. Use `git add --intent-to-add /path/to/file`

3. Now `git add -p` fails with the error below
fatal: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.

Originally posted by @wvega-godaddy in https://github.com/so-fancy/diff-so-fancy/issues/35#issuecomment-749565403

Having the same issue here, on Git 2.47.0 and diff-so-fancy 1.4.4. I use --intent-to-add all the time in NixOS, because any untracked files are ignored by the system. Would love to see this fixed.

llakala avatar Nov 15 '24 17:11 llakala

And you do have git config --global interactive.diffFilter 'diff-so-fancy --patch' set?

OJFord avatar Nov 19 '24 17:11 OJFord

And you do have git config --global interactive.diffFilter 'diff-so-fancy --patch' set?

Yes, see this Asciinema for a demonstration of how to replicate the issue.

llakala avatar Nov 19 '24 18:11 llakala

Same thing happens for me, diff-so-fancy v1.4.4 and git v2.51.2. I'm adding a new (binary: PDF) file and getting the same error. I have set git config --global interactive.diffFilter 'diff-so-fancy --patch'.

tdewolff avatar Oct 31 '25 22:10 tdewolff