git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to implement the "amend!" commit ?

From
Charvi Mendiratta <charvi077@gmail.com>
Date
Jan 17, 2021, 07:46 UTC
Message-ID
<CAPSFM5eiZF0hqckUyx-Ak0sHs1RYcWEE_Db1G+6i=thhrObj=Q@mail.gmail.com>
In-Reply-To
<xmqq4kjgnpxf.fsf@gitster.c.googlers.com>
Hi Junio,
On Sun, 17 Jan 2021 at 10:03, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
>
> Charvi Mendiratta <charvi077@gmail.com> writes:
>
> > 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".

Thanks for explaining, now I can relate with the previous discussions and will look around for the implementation in the above way. I think may be we can do this while parsing the options and checking for the list of prefixes, I am not sure but will look into it.

Thanks and Regards, Charvi

Previous: Junio C HamanoNext: Charvi Mendiratta
Message 14 of 15 in “How to implement the "amend!" commit ?”
  1. Charvi MendirattaJan 13, 2021
  2. Taylor BlauJan 13, 2021
  3. Taylor BlauJan 13, 2021
  4. Charvi MendirattaJan 14, 2021
  5. Phillip WoodJan 14, 2021
  6. Taylor BlauJan 14, 2021
  7. Phillip WoodJan 15, 2021
  8. Martin ÅgrenJan 15, 2021
  9. Junio C HamanoJan 14, 2021
  10. Phillip WoodJan 15, 2021
  11. Junio C HamanoJan 15, 2021
  12. Charvi MendirattaJan 17, 2021
  13. Junio C HamanoJan 17, 2021
  14. Charvi MendirattaJan 17, 2021
  15. Charvi MendirattaJan 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.