Thread (4 messages) flat view 4 messages, 4 authors, 2018-12-14

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

From: Johannes Schindelin <hidden>
Date: 2018-12-14 13:39:59

Hi Oliver,

On Fri, 14 Dec 2018, Oliver Joseph Ash wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help