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

Re: Squashing commits with git rebase -i may miscount commits in commit message

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 6, 2017, 13:46 UTC
Message-ID
<alpine.DEB.2.20.1701061445130.3469@virtualbox>
In-Reply-To
<CAMWRQeRaQQQcJ-R8eHc7f0KqZF2eEkYJOyTb9n7ds78pTqV-AA@mail.gmail.com>
Hi,
On Fri, 6 Jan 2017, Brandon Tolsch wrote:
Show 28 quoted lines
> git --version: 2.11.0
> 
> When using git rebase -i to squash a series of commits that includes
> more than 10 commits, the generated commit message you are given to
> edit counts the old messages incorrectly.  It will say the total
> number of commits is (actual % 10) (if they were 0-based) and it will
> also count the commits as (actual % 10).
> 
> For example, 15, 25, 35, etc. commits:
> # This is a combination of 5 commits.
> # This is the 1st commit message:
> msg
> 
> # This is the commit message #2:
> ...
> ...
> # This is commit message #10:
> msg
> 
> # This is commit message #1:
> ...
> 
> # This is commit message #5:
> msg
> 
> While not a big issue, it did make me double check what I was doing
> when I saw "a combination of 10 commits" instead of 20 in the commit
> message.

Just for the record: I verified that the rebase--helper based interactive rebase (which is already in Git for Windows since v2.10.0) does *not* have this bug.

Maybe a point in favor rebase--helper...

Ciao, Johannes

Previous: Brandon TolschNext: Jeff King
Message 2 of 6 in “Squashing commits with git rebase -i may miscount commits in commit message”
  1. Brandon TolschJan 6, 2017
  2. Johannes SchindelinJan 6, 2017
  3. rebase--interactive: count squash commits above 10 correctlyJeff King, Jan 7, 2017
  4. Johannes SchindelinJan 7, 2017
  5. Jeff KingJan 7, 2017
  6. Junio C HamanoJan 8, 2017

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.