Skip to content

Commit ce4296c

Browse files
committed
Merge branch 'cm/rebase-i'
"rebase -i" is getting cleaned up and also enhanced. * cm/rebase-i: doc/git-rebase: add documentation for fixup [-C|-c] options rebase -i: teach --autosquash to work with amend! t3437: test script for fixup [-C|-c] options in interactive rebase rebase -i: add fixup [-C | -c] command sequencer: use const variable for commit message comments sequencer: pass todo_item to do_pick_commit() rebase -i: comment out squash!/fixup! subjects from squash message sequencer: factor out code to append squash message rebase -i: only write fixup-message when it's needed
2 parents 8c81fce + 2c0aa2c commit ce4296c

9 files changed

+587
-61
lines changed

Documentation/git-rebase.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,17 @@ If you want to fold two or more commits into one, replace the command
887887
"pick" for the second and subsequent commits with "squash" or "fixup".
888888
If the commits had different authors, the folded commit will be
889889
attributed to the author of the first commit. The suggested commit
890-
message for the folded commit is the concatenation of the commit
891-
messages of the first commit and of those with the "squash" command,
892-
but omits the commit messages of commits with the "fixup" command.
890+
message for the folded commit is the concatenation of the first
891+
commit's message with those identified by "squash" commands, omitting the
892+
messages of commits identified by "fixup" commands, unless "fixup -c"
893+
is used. In that case the suggested commit message is only the message
894+
of the "fixup -c" commit, and an editor is opened allowing you to edit
895+
the message. The contents (patch) of the "fixup -c" commit are still
896+
incorporated into the folded commit. If there is more than one "fixup -c"
897+
commit, the message from the last last one is used. You can also use
898+
"fixup -C" to get the same behavior as "fixup -c" except without opening
899+
an editor.
900+
893901

894902
'git rebase' will stop when "pick" has been replaced with "edit" or
895903
when a command fails due to merge errors. When you are done editing

rebase-interactive.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ void append_todo_help(int command_count,
4444
"r, reword <commit> = use commit, but edit the commit message\n"
4545
"e, edit <commit> = use commit, but stop for amending\n"
4646
"s, squash <commit> = use commit, but meld into previous commit\n"
47-
"f, fixup <commit> = like \"squash\", but discard this commit's log message\n"
47+
"f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
48+
" commit's log message. Use -C to replace with this\n"
49+
" commit message or -c to edit the commit message\n"
4850
"x, exec <command> = run command (the rest of the line) using shell\n"
4951
"b, break = stop here (continue rebase later with 'git rebase --continue')\n"
5052
"d, drop <commit> = remove commit\n"

0 commit comments

Comments
 (0)