Skip to content

Document how jj and git interpret DiffSpec - #28

Open
Techcable wants to merge 2 commits into
ZelAnton:mainfrom
Techcable:docs/explain-diffspec-interpretation
Open

Document how jj and git interpret DiffSpec#28
Techcable wants to merge 2 commits into
ZelAnton:mainfrom
Techcable:docs/explain-diffspec-interpretation

Conversation

@Techcable

Copy link
Copy Markdown
Contributor

What & why

Document how git and jj each interpret a DiffSpec passed to diff_text and friends.

Guarantee that this interpretation is stable, and changing it would be a semver-breaking change.

Checklist

  • cargo fmt --all
  • cargo clippy --workspace --all-targets --all-features -- -D warnings is clean
  • cargo test --workspace --all-features passes (and cargo test -- --ignored if you
    touched a real-binary path)
  • The affected crate's CHANGELOG.md [Unreleased] is updated when the change is
    user-facing (Added / Changed / Fixed)
  • Docs updated (rustdoc and the docs/ guide set) if behavior or API changed
  • (N/A) New dependencies carry a "why" comment in Cargo.toml

Techcable and others added 2 commits August 1, 2026 23:23
Rev(rev) is a direct passthrough to git's single positional diff argument — not something this crate parses or classifies.

The working-copy-inclusion behavior for a lone revision is a consequence of that passthrough.
It always diffs against the working tree, not the revision against its parent.
Document this on GitApi::diff_text and in the git.md guide.

Note that this DiffSpec interpretation is stable,
and changing it would be semver-breaking change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rev is passed straight through to jj diff -r,
so it diffs the revset against its parent(s),
not the working copy — unlike vcs_git's Rev,
which always includes working-copy changes for a single revision.

Note that this DiffSpec interpretation is stable, semver-guarded behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Techcable Techcable changed the title Document how jj and git interpret Document how jj and git interpret DiffSpec Aug 2, 2026
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.

1 participant