Skip to content

Commit

Permalink
Merge branch 'cm/rebase-i'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
gitster committed Mar 26, 2021
2 parents 8c81fce + 2c0aa2c commit ce4296c
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 61 deletions.
14 changes: 11 additions & 3 deletions Documentation/git-rebase.txt
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,17 @@ If you want to fold two or more commits into one, replace the command
"pick" for the second and subsequent commits with "squash" or "fixup".
If the commits had different authors, the folded commit will be
attributed to the author of the first commit. The suggested commit
message for the folded commit is the concatenation of the commit
messages of the first commit and of those with the "squash" command,
but omits the commit messages of commits with the "fixup" command.
message for the folded commit is the concatenation of the first
commit's message with those identified by "squash" commands, omitting the
messages of commits identified by "fixup" commands, unless "fixup -c"
is used. In that case the suggested commit message is only the message
of the "fixup -c" commit, and an editor is opened allowing you to edit
the message. The contents (patch) of the "fixup -c" commit are still
incorporated into the folded commit. If there is more than one "fixup -c"
commit, the message from the last last one is used. You can also use
"fixup -C" to get the same behavior as "fixup -c" except without opening
an editor.


'git rebase' will stop when "pick" has been replaced with "edit" or
when a command fails due to merge errors. When you are done editing
Expand Down
4 changes: 3 additions & 1 deletion rebase-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ void append_todo_help(int command_count,
"r, reword <commit> = use commit, but edit the commit message\n"
"e, edit <commit> = use commit, but stop for amending\n"
"s, squash <commit> = use commit, but meld into previous commit\n"
"f, fixup <commit> = like \"squash\", but discard this commit's log message\n"
"f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
" commit's log message. Use -C to replace with this\n"
" commit message or -c to edit the commit message\n"
"x, exec <command> = run command (the rest of the line) using shell\n"
"b, break = stop here (continue rebase later with 'git rebase --continue')\n"
"d, drop <commit> = remove commit\n"
Expand Down
Loading

0 comments on commit ce4296c

Please sign in to comment.