Draft
Conversation
`but amend` accepted comma-separated file IDs, but each selected file was amended into the original commit ID. The first amend rewrote the target commit, so the second amend could fail because the branch no longer contained the original commit. Track the rewritten commit ID returned by each amend and use it as the target for the next selected file. In JSON mode, aggregate the per-file rewrite results into one JSON document so `--json` and `--json --status-after` remain valid. Add CLI regression coverage for multi-file amend, JSON status-after output, and a duplicate-file no-op after a successful amend. Validation: - cargo test -p but --test but amend -- --nocapture - cargo test -p but --test but command::rub - cargo fmt --check --all
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
Fixes #12533.
but amendcan accept comma-separated file IDs, but it amended each selected file into the original target commit ID. Since each amend rewrites the target commit, the second selected file could fail because the branch no longer contained the original commit.This PR updates the amend flow to carry the rewritten commit ID forward between selected files. It also aggregates JSON output into a single result for multi-file amend so
--jsonand--json --status-afterstay valid.Tests
cargo test -p but --test but amend -- --nocapturecargo test -p but --test but command::rubcargo fmt --check --allcodex review --commit 1dfe294afb21690537f1e70c5c04bd9a71c3af1eDisclosure
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.