🐛 mismatched output from interactive.diffFilter
OS: NixOS delta version: 0.18.2 git version: 2.51.2
When trying to run git add --patch I now get an error:
$ git add --patch
error: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.
This had been working properly for years. No changes have been made to my configuration, though I'm not sure which version of delta introduced the issue.
I suspect it might be related to issues #1650 and possibly #328.
The git config is set to interactive.difffilter=/nix/store/aq1x56ai959i2jqm315c83nzcw0p659w-delta-0.18.2/bin/delta --color-only.
(If you are not familiar with Nix, just know that the long nix store path containing the package checksum is correct. Nix refers to reproducible builds in its store.)
Hi @egrieco, can you post an example diff / hunk that repros the problem? There are extensive tests in delta for the 1-1 correspendence and I believe that other than this ticket there aren't current problems with it. Could you try some different versions of delta?
Not sure if this will help, but I ran git config set interactive.difffilter cat and then git add --patch. Then I copied the output:
+- [ ] Add build directories or otherwise cleanable/caches to the size info
+- [ ] Add comparison/transformation of URLs
+ - [ ] Main
+ - [ ] Issues
+ - [ ] PRs
+ - [ ] Wiki
+ - [ ] Settings
These are just some TODOs that I have not committed on one of my projects. When running git add --patch with interactive.diffFilter = delta --color-only this causes the warning:
error: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.
Let me know how else I can help troubleshoot this issue.
I'm seeing the same error when I use git add -up, but git diff works fine:
[pager]
log = delta --relative-paths
show = delta --relative-paths
diff = delta --relative-paths
[interactive]
diffFilter = delta --relative-paths --line-numbers --color-only --features=interactive
The following also fails with the same error:
[interactive]
diffFilter = delta --relative-paths
Diff:
> git --no-pager diff
diff --git a/requirements.txt b/requirements.txt
index 69aeaa6d..f9375f2b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -37,29 +37,6 @@ automat==25.4.16 \
--hash=sha256:0017591a5477066e90d26b0e696ddc143baafd87b588cfac8100bc6be9634de0 \
--hash=sha256:04e9bce696a8d5671ee698005af6e5a9fa15354140a87f4870744604dcdd3ba1
# via twisted
-awslambdaric==3.1.1 \
- --hash=sha256:09ba762169869c576f8842d2b08fa6e30254494eabe533eb77efef0e38af33fa \
- --hash=sha256:0b30fd0b2e62c46c268eaf316c3bc77ba6d3900caea3c81cdf211952062e118f \
- --hash=sha256:134b5132803094ce0488f2b3e071745f09779c583371e84bc5979c21a5bac46a \
- --hash=sha256:1c1fd30570b9a2c5cc4ccd2151c883312c5eef2dbf759c8e9d29c18cec6de2e8 \
- --hash=sha256:2cd110915f17967bfc39079c37efd7f9ca65eedb049c79f5203f02dcb3a514fc \
- --hash=sha256:329bd2e09d6a8257b9a7ff386d9956783ec905bba4c00ea2f841fbc89246910e \
- --hash=sha256:37159c9f67d5cced4dcf72963d29dcac48b214f601931d15b78f58a1336c9dc5 \
- --hash=sha256:4972127ef34729c44c9567148e68a4eacc283d685400f9d08bf51138ac4ee3d5 \
- --hash=sha256:537e4986f723cb981af01d031743c9ae09b9ddc497d2582a548da0d696c81809 \
- --hash=sha256:6c8ecbcf05cf02f1bd263a0831b1acf3c29cd9296cb72e74067de71185f6c118 \
- --hash=sha256:755db7118d1ed900a675a2608ea9c48c463949ede5cc91648c542a5ec89df4ed \
- --hash=sha256:7b7e44922dc4f22cdc9462d5eb41b43f8edfd4ec091f26b91bcbd9eec9c0e368 \
- --hash=sha256:84855b22f2dfb68f1180ea9acbd18e5b636aed02d45e88d7bdfbf10551ba5658 \
- --hash=sha256:889b4bb6e9d88aab26d67cce7f9212aafa1f53c64eca2dc83cdf42a79eb3e6ec \
- --hash=sha256:9bb003f14f3754a3d6912e3a478cf3a306b84febdc26b612fe23c1143a89f0fd \
- --hash=sha256:a5860d96e08cc4bab5bd4d7a2cd5eeb10ea17d0269fe4c1b7c57ac8d06abbf70 \
- --hash=sha256:a7066867f704675c65da522ee28174d674b847f7df9479eb7f60cbba2ab85e09 \
- --hash=sha256:a9d0d3de5a3fd9b2d8496b07e30b471b74d6a7839c878bef89419db0dae8795e \
- --hash=sha256:ad2ff7352517b590ca5748f75b9b9df906b111139753f35bcb069f25c14d3c94 \
- --hash=sha256:dc30e9b674828b4d00f703f7774e1bc6e78f8cc1b7fd577e583d66e1c62734ea \
- --hash=sha256:fbe854813e5a1bac7d68cc05827dbcf5eb7fd2158ec2e6972d5643d00c3f3f61
- # via photostore (pyproject.toml)
beautifulsoup4==4.13.4 \
--hash=sha256:9bbbb14bfde9d79f38b8cd5f8c7c85f4b8f2523190ebed90e950a8dea4cb1c4b \
--hash=sha256:dbb3c4e1ceae6aefebdaf2423247260cd062430a410e38c66f2baa50a8437195
Another failing example:
> git add -up .
error: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.
> git --no-pager diff .
diff --git a/home/.config/git/config b/home/.config/git/config
index 03b45aaf..19b6f9f7 100644
--- a/home/.config/git/config
+++ b/home/.config/git/config
@@ -26,6 +26,7 @@
show = delta --relative-paths
diff = delta --relative-paths
[interactive]
+ # Broken: https://github.com/dandavison/delta/issues/2062
diffFilter = delta --relative-paths --line-numbers --color-only --features=interactive
[delta]
commit-decoration-style = bold ol dim yellow
System info:
> git --version
git version 2.52.0
> delta --version
delta 0.18.2
> cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.23.0_rc1
PRETTY_NAME="Alpine Linux v3.23"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
I'm thinking of doing a git bisect on delta to try and figure out what changed. It was working, but suddenly it's not. This smells of a regression.
Just gotta find the time.
I just can't reproduce that, target/debug/delta --version is 0.18.2 and git 2.47.3. I would have guessed --line-numbers to be the cause, but to my surprise that works fine here.
Can you provide all delta config sections, the full file (commited), then the diff on which to call git add -p .