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

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

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Jan 15, 2021, 18:05 UTC
Message-ID
<CAN0heSqnaOi+2k_2mtKBW4wPoGSZ=nAkt1wQaeocgKy9s7b45g@mail.gmail.com>
In-Reply-To
<0236bb58-61a7-6126-b50f-93e8b6bf3aef@gmail.com>
On Fri, 15 Jan 2021 at 12:08, Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 20 quoted lines
>
> On 14/01/2021 17:32, Taylor Blau wrote:
> > On Thu, Jan 14, 2021 at 10:39:50AM +0000, Phillip Wood wrote:
> >>> Secondly, As an alternative to above, we can use `--fixup=<commit>
> >>> --amend` and `--fixup=<commit> --reword`.
> >>
> >> This is not backwards compatible. At the moment If you create a fixup with
> >> `git commit --fixup=aaa` and then realize it should refer to commit bbb
> >> instead you can fix it with `git commit --amend --fixup=bbb`. That would no
> >> longer be possible.
> >
> > Too bad. I felt that this was the most ergonomic idea put forwards, but
> > I also thought that we died with '--amend --fixup=xxx'. Its current
> > behavior does make sense to me, but it's too bad that we can't use it
> > for this new purpose.
>
> I guess we could decide to change the behavior but I'm not sure there is
> a sufficiently compelling reason to do that. I agree the current
> behavior makes sense but (based on no data at all) I'm not sure that it
> is used very much. [...]

Data point: I've done this more than once to correct my choice of which commit to fixup. I'd like to think I'm not very special, so I would guess that I'm not the *only one* who has come up with that and found it useful. As for being used "very much", no idea.

But regardless of that, it feels awkward to me to tie those two options together. That feeling might well correlate with having found that combo to be useful in the first place, though.

Martin
Previous: Phillip WoodNext: Junio C Hamano
Message 8 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.