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

Re: Bug: `git commit --fixup` with duplicate commit messages

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 14, 2018, 13:39 UTC
Message-ID
<nycvar.QRO.7.76.6.1812141438340.43@tvgsbejvaqbjf.bet>
In-Reply-To
<CADBHO9E7Bzk9C5ciC416S+5-cS2ANA9d+CzSjKSG+HyxwrU+2w@mail.gmail.com>
Hi Oliver,
On Fri, 14 Dec 2018, Oliver Joseph Ash wrote:
Show 17 quoted lines
> I believe I have found a bug in `git commit --fixup`.
> 
> Steps to reproduce:
> 1. Create a git history with two commits (A and B) with the same
> commit message (e.g. foo)
> 2. Create a new commit using `git commit --fixup {SHA}`, referring to
> the last commit SHA
> 3. Run an interactive rebase
> 
> Expected: the fixup commit should appear below the last commit in the todo list.
> 
> Actual: the fixup commit appears below the first commit in the todo list.
> 
> It seems that the fixup commit is moved below the most recent commit
> with a matching commit message, however in this case there are
> duplicate commit messages. I would expect the fixup commit to be moved
> below the commit SHA I specified when I ran `git commit --fixup`.

Yes, this is a problem of the design of this feature. It was done partially, I believe, to survive multiple rebases *without* --autosquash before a final rebase *with* --autosquash.

The behavior really is by design.

Ciao, Johannes

Previous: Oliver Joseph AshNext: Rafael Ascensão
Message 2 of 4 in “Bug: `git commit --fixup` with duplicate commit messages”
  1. Oliver Joseph AshDec 14, 2018
  2. Johannes SchindelinDec 14, 2018
  3. Rafael AscensãoDec 14, 2018
  4. John PassaroDec 14, 2018

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.