Running gix diff file :README.md README.md in order to get a diff of the file at HEAD with the version on disk fails on current main with the following error message:
Error: couldn't parse revision: "README.md"
Caused by:
The ref partially named "README.md" could not be found
To reproduce:
- Add one line to
README.md.
- Run
cargo run -- diff file :README.md README.md
Expected result:
❯ cargo run -- diff file :README.md README.md
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
Running `target/debug/gix diff file ':README.md' README.md`
@@ -1,3 +1,6 @@
+This is for testing. We want to find the correct invocation for `gix diff file
+…` to show these lines as additions.
+
[](https://github.com/GitoxideLabs/gitoxide/actions)
[](https://crates.io/crates/gitoxide)
<img src="etc/msrv-badge.svg">
Actual result:
❯ cargo run -- diff file :README.md README.md
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
Running `target/debug/gix diff file ':README.md' README.md`
Error: couldn't parse revision: "README.md"
Caused by:
The ref partially named "README.md" could not be found
I ran git bisect to find the commit that introduced the error, and it found a commit that is not related to rev-parsing at all:
499402c941e85e6cff5c3ffef8a09afac842c7ac is the first bad commit
commit 499402c941e85e6cff5c3ffef8a09afac842c7ac
Author: Sebastian Thiel <[email protected]>
Date: Sun Jan 18 10:43:49 2026 +0100
Make `Exn` work properly after the type was erased.
gix-error/src/exn/impls.rs | 17 ++++++++++++++++-
gix-error/tests/error/exn.rs | 18 ++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
499402c
I reverted the change on main, re-ran cargo run -- diff file :README.md README.md and the error was gone, so it actually seems related to this specific change.
This went unnoticed since we currently don’t have regression tests for gix diff file.
Running
gix diff file :README.md README.mdin order to get a diff of the file atHEADwith the version on disk fails on currentmainwith the following error message:To reproduce:
README.md.cargo run -- diff file :README.md README.mdExpected result:
Actual result:
I ran
git bisectto find the commit that introduced the error, and it found a commit that is not related to rev-parsing at all:499402c
I reverted the change on
main, re-rancargo run -- diff file :README.md README.mdand the error was gone, so it actually seems related to this specific change.This went unnoticed since we currently don’t have regression tests for
gix diff file.