Re: Bug in rebase --autosquash
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 19, 2022, 11:09 UTC
- Message-ID
- <8p78q4p9-9ro4-p5s4-r738-7sno17rqr414@tzk.qr>
- In-Reply-To
- <20220817094909.v2ev4rpsmxjnii4x@pengutronix.de>
Hi Uwe,
On Wed, 17 Aug 2022, Uwe Kleine-König wrote:
Show 35 quoted lines
> after: > > uwe@taurus:~/tmp/git$ git version > git version 2.37.2 > uwe@taurus:~/tmp/git$ git init > Initialized empty Git repository in /home/uwe/tmp/git/.git/ > uwe@taurus:~/tmp/git$ echo contnt > file > uwe@taurus:~/tmp/git$ git add file > uwe@taurus:~/tmp/git$ git commit -m 'file with content' > ... > uwe@taurus:~/tmp/git$ echo 'content' > file > uwe@taurus:~/tmp/git$ git commit --fixup=@ file > [main ef8f0bd27a56] fixup! file with content > uwe@taurus:~/tmp/git$ echo 'more content' >> file > uwe@taurus:~/tmp/git$ git commit --fixup=@ file > [main b40a214bf5fb] fixup! fixup! file with content > 1 file changed, 1 insertion(+) > > running > > git rebase -i --autosquash @~2 > > my editor presents me with: > > pick ef8f0bd27a56 fixup! file with content > pick b40a214bf5fb fixup! fixup! file with content > > However I would have expected > > pick ef8f0bd27a56 fixup! file with content > fixup b40a214bf5fb fixup! fixup! file with content > > instead. > > Is this a feature I don't understand?
This demonstrates a somewhat obscure feature where the `fixup!` of a `fixup!` magically targets the original commit.
I understand that it is somewhat unintuitive that `fixup! fixup! abc` does not target `fixup! abc` but instead `abc`, but that's how the tool has been behaving forever.
Ciao, Dscho