Skip to content

Add --in-git-diff convenience option#628

Open
ychampion wants to merge 1 commit into
sourcefrog:mainfrom
ychampion:fix/in-git-diff-245
Open

Add --in-git-diff convenience option#628
ychampion wants to merge 1 commit into
sourcefrog:mainfrom
ychampion:fix/in-git-diff-245

Conversation

@ychampion

Copy link
Copy Markdown

Summary

  • add --in-git-diff REVISION as a convenience wrapper around git diff
  • reuse the existing diff filter and cover nested workspaces and invalid revisions

Why

This avoids writing a temporary patch file when testing changes from a branch or pull request.

Closes #245.

Validation

  • cargo test --locked diff -- --nocapture
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • cargo fmt --all -- --check
  • cargo build --release --locked
  • cargo machete

Add the maintainer-requested Git revision adapter while reusing the existing unified-diff filter. Keep explicit patch-file input unchanged and cover nested workspaces plus invalid revisions.

Constraint: Use the Git CLI requested in sourcefrog#245 without adding a dependency.
Rejected: git2-rs | Unnecessary build weight for a single diff invocation.
Confidence: high
Scope-risk: narrow
Directive: Keep --in-diff and --in-git-diff mutually exclusive.
Tested: Focused diff tests; strict all-target/all-feature Clippy; 429/431 all-feature nextest cases; release build and nested-workspace smoke; rustfmt; cargo-machete; diff checks.
Not-tested: mdBook linkcheck and typos binaries are unavailable locally; two permission-denied tests fail as root identically on upstream.
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.

--in-git-diff convenience option

1 participant