-
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
[git 2.17.0] fatal: mismatched output from interactive.diffFilter #296
Comments
This is related to #35. D-s-f and patch mode are not currently compatible. |
But it was working (almost) fine up to now. Is there some workaround that I could use? |
@boris-petrov downgrade Git? Git decided to make that change to avoid people hitting bug #35. There may be a potential solution in some code to upstream git. That was recently mentioned in #35. I'm going to close this for now. If you have further comments about working around this I think we should move them to #35. |
This also affects |
I ran into this once I added:
and used |
Downgrading git is no longer a viable strategy with the remote code vulnerability in git <2.17.1. @scottchiefbaker could we re-open this issue until it's fixed? |
@jesstelford I could re-open this... but the core issue is #35. I think maybe we move things over there? I'm open to suggestions. |
Apologies, I thought #35 was dead - 10months with no updates (on either side). Happy to leave the discussion there. |
It's only "dead" in the sense that we can't fix anything on the d-s-f side to make it work. We need some upstream work on Git done. |
@scottchiefbaker where can we find the description of the required upstream work? Have the |
Even after removing this from my config I still can't use |
Since git version 2.17.0 diff-so-fancy does not work with interactive.diffFilter (so-fancy/diff-so-fancy#296).
Related to so-fancy/diff-so-fancy#35 and so-fancy/diff-so-fancy#296. The reason are incompatibility problems of "diff-so-fancy" (1) with the latest Git versions caused by changes in the diff logic. ```raw fatal: mismatched output from interactive.diffFilter hint: Your filter must maintain a one-to-one correspondence hint: between its input and output lines. ``` See so-fancy/diff-so-fancy#35 and so-fancy/diff-so-fancy#296 for details. Note that downgrading to a compatible Git version is not an option because versions <2.17.1 are effected by CVE-2018-11233 and and 11235 (2). To fix this problem for interactive patch mode (3) the filter will temporary be changed to the official diff-highlight (4) tool bundled with Git. ```diff [interactive] - diffFilter = diff-so-fancy + diffFilter = diff-highlight ``` References: (1) https://github.com/so-fancy/diff-so-fancy (2) https://github.com/git/git/blob/master/Documentation/RelNotes/2.17.1.txt#L7-L10 (3) https://github.com/arcticicestudio/igloo/blob/bb19634544f91c26d66e1f7f53a6bf06210fbaaf/snowblocks/git/gitconfig#L214-L220 (4) https://github.com/git/git/tree/master/contrib/diff-highlight Closes GH-125
@adamtaylor13 It's been about a half-year since you asked, but in case you still don't have a way of solving this, or in case someone else reads your comment and wishes for a quick & easy solution... Git is trying to use This solution is guaranteed to work, since it will mask any other config options declared in the multiple levels: add e.g. git -c 'interactive.diffFilter=less' add -p README.md To make things easier for you, I would suggest adding an alias or two to whatever your alias gap="git -c 'interactive.diffFilter=less' add --patch"
# ... and other similars:
alias grp="git -c 'interactive.diffFilter=less' reset --patch"
alias gcop="git -c 'interactive.diffFilter=less' commit --patch"
alias gsp="git -c 'interactive.diffFilter=less'stash --patch"
|
diff-so-fancy [1] provided a way better highlighting than diff-highlight [2], the tool that is shipped with Git. Anyway, next to the fact that it is written in Perl and required yet another interpreter installation, there have also been long-time problems regarding the `fatal: mismatched output` error when running as `interactive.diffFilter`. In so-fancy/diff-so-fancy#296 and so-fancy/diff-so-fancy#35 are long discussions and some proposed workarounds, but none really worked properly. Therefore I switched to delta [3] a while ago and the configurations have now been tested enough on a day-by-day basis to be persisted in igloo. delta not only provides the same features like diff-so-fancy and other highlighters [4] but comes with many more advantages. The highlighting can also be styled using the same themes like bat [5] that is also already available as snowblock [6]. The colors have been adjusted to match the Nord [7] theme. Note that the Nord color palettes must be provided through the terminal [8] as the 16 ANSI base colors. Some diff specific colors have been specified as HEX tripplets. The background colors for added, removed and modified lines are adjusted in brightness and saturation using the `scale()` function [9] of the `color` module [10] provided by the official Sass reference implementation written in Dart [11]. ```scss @use "sass:color"; $nord10: #5e81ac; $nord11: #bf616a; $minus-color: color.scale($nord11, $lightness: -28%, $saturation: -20%); $plus-color: color.scale($nord10, $lightness: -22%, $saturation: -16%); ``` [1]: https://github.com/so-fancy/diff-so-fancy [2]: https://github.com/git/git/tree/master/contrib/diff-highlight [3]: https://github.com/dandavison/delta [4]: https://github.com/dandavison/delta#features [5]: https://github.com/sharkdp/bat [6]: https://github.com/arcticicestudio/igloo/tree/master/snowblocks/bat [7]: https://www.nordtheme.com [8]: https://www.nordtheme.com/ports [9]: https://sass-lang.com/documentation/modules/color#scale [10]: https://sass-lang.com/documentation/modules [11]: https://github.com/sass/dart-sass GH-281 Co-authored-by: Sven Greb <[email protected]>
diff-so-fancy [1] provided a way better highlighting than diff-highlight [2], the tool that is shipped with Git. Anyway, next to the fact that it is written in Perl and required yet another interpreter installation, there have also been long-time problems regarding the `fatal: mismatched output` error when running as `interactive.diffFilter`. In so-fancy/diff-so-fancy#296 and so-fancy/diff-so-fancy#35 are long discussions and some proposed workarounds, but none really worked properly. Therefore I switched to delta [3] a while ago and the configurations have now been tested enough on a day-by-day basis to be persisted in igloo. delta not only provides the same features like diff-so-fancy and other highlighters [4] but comes with many more advantages. The highlighting can also be styled using the same themes like bat [5] that is also already available as snowblock [6]. The colors have been adjusted to match the Nord [7] theme. Note that the Nord color palettes must be provided through the terminal [8] as the 16 ANSI base colors. Some diff specific colors have been specified as HEX triplets. The background colors for added, removed and modified lines are adjusted in brightness and saturation using the `scale()` function [9] of the `color` module [10] provided by the official Sass reference implementation written in Dart [11]. ```scss @use "sass:color"; $nord10: #5e81ac; $nord11: #bf616a; $minus-color: color.scale($nord11, $lightness: -28%, $saturation: -20%); $plus-color: color.scale($nord10, $lightness: -22%, $saturation: -16%); ``` [1]: https://github.com/so-fancy/diff-so-fancy [2]: https://github.com/git/git/tree/master/contrib/diff-highlight [3]: https://github.com/dandavison/delta [4]: https://github.com/dandavison/delta#features [5]: https://github.com/sharkdp/bat [6]: https://github.com/arcticicestudio/igloo/tree/master/snowblocks/bat [7]: https://www.nordtheme.com [8]: https://www.nordtheme.com/ports [9]: https://sass-lang.com/documentation/modules/color#scale [10]: https://sass-lang.com/documentation/modules [11]: https://github.com/sass/dart-sass Closes GH-281 Co-authored-by: Sven Greb <[email protected]>
The [alias]
addp = -c 'interactive.diffFilter=less' add -p |
so ... is this possible or not? the main page README says i can do it, yet I did and i get this error. i am confused. any info? |
It's been working for months and months, and now it no longer works again. 😅 |
same with me - it stopped working a few weeks ago! I have the latest git version: 2.40.0 |
Due to bugs like this so-fancy/diff-so-fancy#296
Following the information at so-fancy/diff-so-fancy#296 I have removed the --patch flag from diff-so-fancy to keep interactive patch additions working. This seems to be working locally with kitty now. Signed-off-by: Dan Kalowsky <[email protected]>
Following the information at so-fancy/diff-so-fancy#296 I have removed the --patch flag from diff-so-fancy to keep interactive patch additions working. This seems to be working locally with kitty now. Signed-off-by: Dan Kalowsky <[email protected]>
I have the following in my
.gitconfig
:Doing a
git add -p
fails with this:This didn't happen before git 2.17.0. Help! I cannot live without dsf, what do I do?!
The text was updated successfully, but these errors were encountered: