Skip to content

amend: Preserve amended commit message on stack replay conflict#272

Open
Abhishek21g wants to merge 1 commit into
Skydio:mainfrom
Abhishek21g:fix/amend-preserve-message-266
Open

amend: Preserve amended commit message on stack replay conflict#272
Abhishek21g wants to merge 1 commit into
Skydio:mainfrom
Abhishek21g:fix/amend-preserve-message-266

Conversation

@Abhishek21g

Copy link
Copy Markdown

Summary

Fixes #266.

When revup amend rewrites a commit message and then fails while replaying the rest of the stack (e.g. merge conflict), the user's new message is now saved under .revup/AMENDED_COMMIT_MSG in the scratch directory and the path is logged. The message is only saved when it actually changed from the original commit.

Repro

  1. Create a stack where amending an earlier commit conflicts with a later commit on the same file
  2. Run revup amend HEAD~1 with --edit and a new message
  3. On conflict, previously the amended message was lost

Fix

  • Add preserve_amended_commit_msg() called from amend conflict paths
  • Only persist when amended_msg != original_msg

Verification

python3 -m pip install -e '.[dev]'
python3 -m pytest tests/test_amend.py::TestAmendConflict -q
make lint

When revup amend fails while replaying the stack, save a changed commit
message to the scratch dir so users can recover it after resolving conflicts.

Fixes Skydio#266
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.

[amend] keep the amended message around in case of a conflict

1 participant