forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rebase -m: fix --signoff with conflicts
When rebasing with "--signoff" the commit created by "rebase --continue" after resolving conflicts or editing a commit fails to add the "Signed-off-by:" trailer. This happens because it reuses the message from the original commit instead of the message that would have used if the sequencer had not stopped for the user interaction. The correct message is stored in ctx->message and so (with a couple of exceptions) we write this to rebase_path_message() when stopping for user interaction instead. The exceptions are (i) "fixup" and "squash" commands where the file is written by error_failed_squash() and (ii) "edit" commands that are fast-forwarded where we continue to reuse the original message. The latter is safe because "--signoff" will never fast-forward. Note this introduces a change in behavior as the message file now contains conflict comments. This is safe because commit_staged_changes() passes an explicit cleanup flag when not editing the message and when the message is being edited it will be cleaned up automatically. This means user now sees the same message in editor with "rebase --continue" as they would if they ran "git commit" themselves before continuing and matches the behavior of "git cherry-pick", "git merge" etc. which all show the list of files with conflicts. The tests are extended to check that all commits made after continuing a rebase have a "Signed-off-by:" trailer. Reported-by: David Bimmler <[email protected]> Signed-off-by: Phillip Wood <[email protected]>
- Loading branch information
1 parent
1072c0c
commit a814b73
Showing
3 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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