Skip to content

fix(diffr): read revisions with gix lib - #1068

Merged
sidkmenon merged 1 commit into
mainfrom
sm/diffr-gix-specs
Oct 9, 2026
Merged

sidkmenon merged 1 commit into
mainfrom
sm/diffr-gix-specs

Conversation

@sidkmenon

@sidkmenon sidkmenon commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Use gix to parse instaed of handrolled parse crap for input git revisions to the diffr cli (e.g. diffr HEAD^1..HEAD).

Text from a clanker:

`diffr X^!` showed `X^` against the working tree. rev-parse accepts `X^!`, so diffr took it for one revision and compared it with the working tree, a different and usually much larger comparison, with no error.

diffr now builds the comparison from the spec gix parses, the way git reads it, instead of splitting `..` and `...` by hand:

- `X^!`: X against its parent; a root commit against the empty tree; a merge is refused, naming its parents.
- `X^-` and `X^-n`: X against its first or nth parent (gix reads these as ranges).
- `a..b` and `a...b`: as before, now from gix's range and merge specs.
- `X^@` and `^X`: refused, since neither names one comparison.
- `--merge-base` and `--cached` keep their rules, checked against the parsed spec.

Tests use git as the oracle: `HEAD^!`, `HEAD^-` and `HEAD^-1` with a dirty working tree, so the old reading would show; `HEAD^@`; and a merge's `^!` against `HEAD^2 HEAD`.

Replaces #1020, which was stacked on the /diffr mod; this is the same change on `main` alone.

https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd

@sidkmenon sidkmenon changed the title diffr: read revisions with gix's specs, so X^! compares the commit fix(diffr): read revisions with gix lib Oct 9, 2026
… git compares (AI-assisted)

Agent-Session: fb96350b-c19e-48f0-b364-31e9ad2b72f4
Agent-Session: 7d7ac281-cc4b-4437-9e1e-3872651e8bcf
Agent-Session: a7af3b88-3bb7-48a2-ae20-7626a83628a1
Claude-Session: https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Agent-Session: ec5d2c35-3045-44f3-9c41-ba4378797c8e
Agent-Session: b5985b3c-e5d2-4bb4-b6ac-7fec168d8328
Agent-Session: 01a11f51-383b-7f63-a323-39195d82ab2e
Agent-Session: cac10624-9b5a-46ba-b261-1e0359c62796
Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
@sidkmenon
sidkmenon enabled auto-merge (squash) October 9, 2026 08:38
@sidkmenon
sidkmenon disabled auto-merge October 9, 2026 08:58
@sidkmenon
sidkmenon enabled auto-merge (squash) October 9, 2026 08:58
@sidkmenon
sidkmenon disabled auto-merge October 9, 2026 08:58
@sidkmenon
sidkmenon merged commit 549961a into main Oct 9, 2026
10 checks passed
@sidkmenon
sidkmenon deleted the sm/diffr-gix-specs branch October 9, 2026 08:58
sidkmenon added a commit that referenced this pull request Oct 9, 2026
Bumps diffr's crates and `@dev.fast/diffr` to 0.1.18, for the
`diffr/0.1.18` release.

0.1.18 is the first release with `config init`, `upgrade` and
`uninstall` (#1066), which the /diffr Claude Code plugin (#1019) and
`install.dev.fast/diffr` need. It also reads revisions with gix's specs
(#1068).

The npm platform packages and Whiteboard's pin move to 0.1.18 in a
follow-up, once the release publishes them.

https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants