Fix but amend with multiple sources by refreshing rewritten commit target#12541
Draft
Fix but amend with multiple sources by refreshing rewritten commit target#12541
but amend with multiple sources by refreshing rewritten commit target#12541Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test for issue 12533 and fix the related problem
Fix Feb 23, 2026
but amend with multiple sources by refreshing rewritten commit target
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.
but amend <source1,source2,...> <commit>was applying the first source, rewriting the commit, then trying to amend the remaining sources into the stale pre-rewrite commit ID. This caused multi-file amend to fail mid-operation.Regression coverage
amend_command_with_multiple_filesincrates/but/tests/but/command/rub.rs.Amend execution now returns rewritten commit ID
crates/but/src/command/legacy/rub/amend.rs:uncommitted_to_commit(...) -> anyhow::Result<Option<ObjectId>>assignments_to_commit(...) -> anyhow::Result<Option<ObjectId>>outcome.new_commitso callers can continue with the latest commit identity.Rub operation pipeline propagates commit rewrites
RubOperation::execute(...)incrates/but/src/command/legacy/rub/mod.rsto returnOption<ObjectId>.None.handle(...)now updates the in-loopCliId::Committarget when an operation rewrites the commit, so subsequent sources amend into the current commit.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.