Re: How to implement the "amend!" commit ?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 17, 2021, 04:33 UTC
- Message-ID
- <xmqq4kjgnpxf.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAPSFM5cEnex1xaBy5ia_xNFDNzt5_Y=W-6TB9d9yW_AiPAKxDg@mail.gmail.com>
Charvi Mendiratta <charvi077@gmail.com> writes:
Show 6 quoted lines
> Earlier, I thought to implement the UI of amend! commit as : > "git commit --fixup=a/amend:<commit>" > > So users can either use 'a' as abbreviation or 'amend'. But I want to once > confirm if I got this right ? As I am doubtful about, what does allowing to > accept any prefix of "amend" and "reword" means ?
It means that all of these do the same thing ...
git commit --fixup=amend:<commit> git commit --fixup=amen:<commit> git commit --fixup=ame:<commit> git commit --fixup=am:<commit> git commit --fixup=a:<commit>
... until somebody more brilliant than either of us comes along and invents another operation that sits next to 'amend' and 'reword', say, 'annoy'. At that point,
git commit --fixup=a:<commit>
no longer uniquely identifies a choice among three ('amend', 'annoy', or 'reword') and you'd give an error message, but
git commit --fixup=am:<commit>
will keep working as an abbreviation for "amend".