-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleted files cause: "error: mismatched output from interactive.diffFilter" #474
Comments
Workaround: Add the following alias:
Usage:
|
Note that the issue here is the two blank lines being added by The cause is likely the same as the one causing issue #473. |
Hi! I ran into the similar issue on a binary diff (.png file). Hope that helps! |
Is this still an active with v1.4.5? I am unable to recreate the issue with the steps you provided above. bakers@basement(~/github/diff-so-fancy)
$ git rm README.md
rm 'README.md'
bakers@basement(~/github/diff-so-fancy)
$ git status --short
D README.md
bakers@basement(~/github/diff-so-fancy)
$ git add --patch README.md
No changes. |
I think the deletion in OP must have been unstaged (i.e. |
@OJFord attempting the same thing with I'm still confused how to recreate this. |
@scottchiefbaker I just reproduced on master with the following commands:
Output is:
|
I suspect this has something to do with the fact that you're deleting a binary file. I don't get this error when I delete a tracked text file. Here is the raw git diff output for a text file that has been
Here is the raw git diff output for a binary file that has been
d-s-f parses removing this binary down to three lines:
Not sure what |
@scottchiefbaker The input is 4 lines, the transformed output is 3. To fix: add a blank like above/below the output header to keep the transformed line count the same as the input. It's the only easily implemented sanity check that the diff filter is not doing something obviously wrong. |
I'm still unable to recreate this reliably so it's hard to test. If the issue really is the 4:3 line ratio I'd expect it to pop up all over d-s-f because we do that for every file change? Is this specifically related to binary files? Or does it apply to text files as well? A "simple" fix would be adding
Right after line 335 which should get you the extra line you're asking for. Try that and let me know? |
Are you calling d-s-f with
If that's not working we may need to implement the above fix wrapped in a |
This is happening for me on longer text files. Just upgraded 1.4.3 -> 1.4.4. Also, I am passing the
|
It seems that the
mismatched output from interactive.diffFilter
issue has struck again in an edge case.I have a deleted, yet-to-be-staged file:
If I try to add it, I get:
Here's the original diff (obtained with
diffFilter="cat"
), and what dsf does with it:Note: if I
git add
the deleted file, agit reset --patch
will cause the same error to occur.The text was updated successfully, but these errors were encountered: