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

Re: Recovering from commit --amend in rebase --interactive

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 2, 2010, 23:37 UTC
Message-ID
<7viq619fah.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTinNpIjirZQL1lBi3t4i6_utCIUMuXc8q2gSJvmO@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 14 quoted lines
>> In general, it might be helpful to warn very loudly upon doing a commit
>> --amend after fixing conflicts, but an implementation would probably be
>> ugly and for all I know, there might be people who frequently cause
>> conflicts while amending; those guys would probably be quite annoyed at
>> such a warning.
>
> I've also introduced the error Peter describes into my history because
> I wasn't careful. That required some splitting / reflog fixes later.
>
> Perhaps the best way to solve this would be to change the content of
> COMMIT_EDITMSG in cases like these so it gives you an explicit warning
> about what you're about to do.
>
> We already do this for merges, from builtin/commit.c:

Very good point. "Users are told when the command gives back control, is the best "rebase -i" could do, but by definition the users are free to shoot themselves in the foot when given control, and "commit --amend" is the only sensible place to give further safeguard against this issue.

Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 6 of 8 in “Recovering from commit --amend in rebase --interactive”
  1. Peter KreftingJun 1, 2010
  2. Boaz HarroshJun 1, 2010
  3. Peter KreftingJun 1, 2010
  4. Jan KrügerJun 1, 2010
  5. Ævar Arnfjörð BjarmasonJun 1, 2010
  6. Junio C HamanoJun 2, 2010
  7. Ævar Arnfjörð BjarmasonJun 3, 2010
  8. Gabriel FilionJun 1, 2010

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.