How to implement the "amend!" commit ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Everyone,

Implementing "amend!" commit would be an alternative to the
fixup!/squash! commit that addresses the issue as opened here[1]. Also
the related patches[2], adds the options to `fixup` command in
interactive rebase and supports the "amend!" commit upon
`--autosquash`. Next, after discussing with Phillip and Christian,
there could be 3 possibilities to implement the "amend!" commit (UI):

Firstly, the `--fixup=<commit>` to have option like,
`--fixup=reword/amend:<commit>`

So, `git commit --fixup` can have 3 options:

a) `--fixup=<commit>`, work as of now, make fixup! commit.
b) `--fixup=amend:<commit>`, make "amend!" commit, takes changes and
also opens the editor for a new message (Here it adds a new message to
amend! commit's message body and upon autosquash it will fixup up the
content and reword the original commit message i.e replaces the
original commit message with the "amend!" commit's message).
c) `--fixup=reword:<commit>`, makes (empty) "amend!" commit, do not
take changes and open the editor for a new message(Here, upon
autosquash it will just reword the original commit message).

Secondly,
As an alternative to above, we can use `--fixup=<commit> --amend` and
`--fixup=<commit> --reword`.

Next,
To use only, `--fixup=<commit> --edit` to make the "amend!" commit.

Also as discussed earlier[3] we are avoiding the use of additional
options like `git commit --amend=<commit>` inorder to avoid confusion
of doing similar things in different ways. So, I wonder which could be
the best way to proceed with or if any other way to implement "amend!"
commit ?

Thanks and Regards,
Charvi

[1] https://github.com/gitgitgadget/git/issues/259
[2] https://lore.kernel.org/git/20210108092345.2178-1-charvi077@xxxxxxxxx/
[3] https://lore.kernel.org/git/95cc6fb2-d1bc-11de-febe-c2b5c78a6850@xxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux