This patch series adds fixup [-C|-c] options to interactive rebase. In
addition to amending the contents of the commit as the `fixup` command
does now, `fixup -C` replaces the commit message of the original commit
which we are fixing up with the message of the fixup commit.
And to edit the fixup commit message before committing, `fixup -c`
command is used instead of `fixup -C`. This convention is similar to
the existing `merge` command in the interactive rebase, that also supports
`-c` and `-C` options with similar meanings.
This patch series also changes `rebase -i --autosquash` to rearrange
commits whose message starts with "amend!" and replaces the pick
command with `fixup -C`. The creation of "amend!" commits will be
rebase -i: add options to fixup command added in another patch series.
This is done in reference to the issue opened by Dscho as here[1] and
further discussed briefly[2]. Also, there is discussion[3] regarding the
implementation of reword! commit. The past patches of Phillip Woodâs
work[4], implements 'reword!' as 'amend!' in git rebase and these patches
uses those as the initial base.
And to avoid the extra command in the interactive rebase, this patch
series instead add options to the current fixup command in interactive
rebase (fixup [-C | -c]) as discussed earlier[5].
Changes from v1 :
* added '< 0' to check that 'write_message()' returns an error
* checks if squash! line commented out in t3415-rebase-autosquash.sh
* removing line break and changing suffix from _str to _fmt in sequencer.c
[1] https://github.com/gitgitgadget/git/issues/259
[2] https://public-inbox.org/git/alpine.DEB.2.21.1.1710151754070.40514@virtualbox/
[3] https://lore.kernel.org/git/95cc6fb2-d1bc-11de-febe-c2b5c78a6850@gmail.com/ (local)
[4] https://github.com/phillipwood/git/commits/wip/rebase-amend
[5] https://lore.kernel.org/git/29fc2f59-1cca-a3db-5586-bbd7b2e4806d@gmail.com/ (local)
Charvi Mendiratta (6):
sequencer: pass todo_item to do_pick_commit()
sequencer: use const variable for commit message comments
rebase -i: add fixup [-C | -c] command
t3437: test script for fixup [-C|-c] options in interactive rebase
rebase -i: teach --autosquash to work with amend!
doc/git-rebase: add documentation for fixup [-C|-c] options
Phillip Wood (3):
rebase -i: only write fixup-message when it's needed
sequencer: factor out code to append squash message
rebase -i: comment out squash!/fixup! subjects from squash message
Documentation/git-rebase.txt | 12 +-
rebase-interactive.c | 4 +-
sequencer.c | 297 +++++++++++++++++++++++++++-----
t/lib-rebase.sh | 4 +
t/t3415-rebase-autosquash.sh | 30 ++--
t/t3437-rebase-fixup-options.sh | 202 ++++++++++++++++++++++
t/t3437/expected-squash-message | 51 ++++++
t/t3900-i18n-commit.sh | 4 -
8 files changed, 543 insertions(+), 61 deletions(-)
create mode 100755 t/t3437-rebase-fixup-options.sh
create mode 100644 t/t3437/expected-squash-message
--
2.29.0.rc1