commit: add amend suboption to --fixup to create amend! commit
commit494d314a0526a8bee9f8af7a6e6b74b66043c9fa
authorCharvi Mendiratta <charvi077@gmail.com>
Mon, 15 Mar 2021 07:54:32 +0000 (15 13:24 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Mar 2021 21:29:35 +0000 (15 14:29 -0700)
tree3889b956d734446ac457e43b920bf462f82c4c2e
parent6e0e28877988f8b98eb1e5cf4d4c5d29cc0b7f77
commit: add amend suboption to --fixup to create amend! commit

`git commit --fixup=amend:<commit>` will create an "amend!" commit.
The resulting commit message subject will be "amend! ..." where
"..." is the subject line of <commit> and the initial message
body will be <commit>'s message.

The "amend!" commit when rebased with --autosquash will fixup the
contents and replace the commit message of <commit> with the
"amend!" commit's message body.

In order to prevent rebase from creating commits with an empty
message we refuse to create an "amend!" commit if commit message
body is empty.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c