# Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits

2 messages from 2021-07-13 to 2021-07-13. Participants: Philippe Blain.
Thread: https://gitlist.dev/t/56100

## Philippe Blain, 2021-07-13 19:34

Subject: Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits
Message-ID: <9515534e-705a-ad1c-a1ac-704b2d565f37@gmail.com>
URL: https://gitlist.dev/e/9515534e-705a-ad1c-a1ac-704b2d565f37%40gmail.com

```
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.

```

## Philippe Blain, 2021-07-13 19:42

Subject: Re: Confusing interaction between 'rebase -i' and 'commit.verbose' when squashing commits
Message-ID: <33021bd4-a126-c740-4a41-f357be8fe6c6@gmail.com>
URL: https://gitlist.dev/e/33021bd4-a126-c740-4a41-f357be8fe6c6%40gmail.com
In-Reply-To: <9515534e-705a-ad1c-a1ac-704b2d565f37@gmail.com>

```
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.


```
