Add --in-git-diff convenience option#628
Open
ychampion wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--in-git-diff REVISIONas a convenience wrapper aroundgit diffWhy
This avoids writing a temporary patch file when testing changes from a branch or pull request.
Closes #245.
Validation
cargo test --locked diff -- --nocapturecargo clippy --all-targets --all-features --locked -- -D warningscargo fmt --all -- --checkcargo build --release --lockedcargo machete