git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits
@ 2021-07-13 19:34 Philippe Blain
  2021-07-13 19:42 ` Philippe Blain
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Blain @ 2021-07-13 19:34 UTC (permalink / raw)
  To: Git mailing list

Hi,

I encountered a situation when I did an interactive rebase and
changed two 'picks' to 'squash', without re-ordering anything.
I have 'commit.verbose' set in my config.

When I then saved the todo list to start the rebase, it opened my
editor to edit the message for the squashed commit. The message shown
in the editor is as expected (the messages from the three commits are shown),
but the diff below the scissors line, due to commit.verbose,
corresponds to the squashed changes only from the
*first two commits* (the 'pick' and the first 'squash'); the changes
from the second 'squash' are missing.

Running 'git diff --cached'
in a second shell shows that those changes (the ones from the second 'squash')
are correctly staged. HEAD points to a commit that has the changes from
the 'pick' and the first 'squash', and as commit message the message I'm
seeing in my editor.

This is rather confusing.

I do not have a quick reproducer unfortunately and I'm in a bit of a rush,
but I thought I'd just send this in case anyone notices quickly why this
happens just by reading the code (I would think somewhere in 'sequencer.c').

Cheers,

Philippe.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits
  2021-07-13 19:34 Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits Philippe Blain
@ 2021-07-13 19:42 ` Philippe Blain
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Blain @ 2021-07-13 19:42 UTC (permalink / raw)
  To: Git mailing list

Le 2021-07-13 à 15:34, Philippe Blain a écrit :
> 
> Running 'git diff --cached'
> in a second shell shows that those changes (the ones from the second 'squash')
> are correctly staged. HEAD points to a commit that has the changes from
> the 'pick' and the first 'squash', and as commit message the message I'm
> seeing in my editor.

Correction: the message in my editor has the messages from all three commits,
but the message of the commit pointed by HEAD only has the messages from the
first two commits, i.e. the 'pick' and the first 'squash'

This is on with Git 2.32.0.1.g2ac0338718.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-13 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 19:34 Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits Philippe Blain
2021-07-13 19:42 ` Philippe Blain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).