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

Re: minor interactive rebase regression: HEAD points to wrong commit while rewording

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2019, 18:17 UTC
Message-ID
<xmqqsgq69rky.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190812175046.GM20404@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 14 quoted lines
> ...
> So far so good.
> Save the updated commit message, and after the editor opens up the
> third commit's log message, check again where HEAD is pointing to now:
>
>   ~/tmp/reword (master +|REBASE-i 2/3)$ head -n1 .git/COMMIT_EDITMSG 
>   third
>   ~/tmp/reword (master +|REBASE-i 2/3)$ git log --oneline -1
>   c3db735 (HEAD) second - updated
>
> As you can see, HEAD still points to the (now rewritten) second
> commit.
>
> It's only HEAD,...
Yuck.

That would still be annoying to some people and outright buggy to others, if their workflow relies on HEAD (e.g. compare with HEAD while reviewing the log messsage) and then now they instead need to adjust (e.g. compare with the index instead). Perhaps you are one of them (apparently I am not, as I did not notice the behaviour change until you pointed it out here).

Previous: SZEDER GáborNext: SZEDER Gábor
Message 2 of 10 in “minor interactive rebase regression: HEAD points to wrong commit while rewording”
  1. SZEDER GáborAug 12, 2019
  2. Junio C HamanoAug 12, 2019
  3. SZEDER GáborAug 12, 2019
  4. Phillip WoodAug 12, 2019
  5. Johannes SchindelinAug 14, 2019
  6. SZEDER GáborAug 14, 2019
  7. SZEDER GáborAug 14, 2019
  8. Phillip WoodAug 15, 2019
  9. Junio C HamanoAug 15, 2019
  10. Junio C HamanoAug 15, 2019

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.