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

Re: [bug report]: error doing_rebase

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 7, 2018, 14:12 UTC
Message-ID
<nycvar.QRO.7.76.6.1802071500020.35@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
In-Reply-To
<0254c12c-e820-9c00-a4d0-2192fca76130@yandex.ru>
Hi Bulat,

Please make sure to keep the Git mailing list in Cc: (I get *very* prickly when Git users treat me as a free-of-cost help desk, and when I get that annoyed, I stop helping).

On Tue, 6 Feb 2018, Bulat Musin wrote:
Show 5 quoted lines
> Yes, I tested again.
> 
> With built 2.16... and it shows error message. git rebase --abort restores
> 
> state before rebase.

You misunderstood me. I am convinced that that error message *is correct*. It shows an incorrect usage. You cannot start off an interactive rebase by a `squash` command.

> With git 2.14 from Ubuntu's repo it works - 3 commits are squashed into first
> one

Yes, but you called `git rebase -i HEAD~2`, which means that only two commits were up for rebasing. The third commit is outside the range `HEAD~2..` which the command `git rebase -i HEAD~2` wants to let you rebase.

If v2.14 indeed modified `HEAD~2` (as I suspected in my earlier mail), then you successfully confirmed that we fixed a bug, and that you expected the buggy behavior.

Show 5 quoted lines
> - with change SHA.
> 
> It seems to be bug in recent version.
> 
> Should I provide additional information?

Ciao, Johannes

Show 27 quoted lines
> On 02/06/2018 12:47 PM, Johannes Schindelin wrote:
> > Hi,
> >
> > On Mon, 5 Feb 2018, Bulat Musin wrote:
> >
> > > Now there are 3 sequential commits, I want to squash them into 1:
> > >
> > > git rebase -i HEAD~2
> > >
> > > In editor I changed all "pick" to "squash", saved file, I got:
> > >
> > > error: cannot 'squash' without a previous commit
> > You cannot start with a squash. You have to pick the first one, then
> > squash the second into the first.
> >
> > > However, 2.14.1 from Ubuntu's repo does the job - squashes 3 commits into
> > > 1.
> > It may be careless enough to do that, however, it might now have modified
> > the *wrong* commit, i.e. squashed the two patches *into HEAD~2*.
> >
> > Please verify that your HEAD~2 is still intact and part of the rebased
> > history, otherwise you will have a problem.
> >
> > Ciao,
> > Johannes
> 
> 
Previous: Johannes Schindelin
Message 3 of 3 in “[bug report]: error doing_rebase”
  1. Bulat MusinFeb 5, 2018
  2. Johannes SchindelinFeb 6, 2018
  3. Johannes SchindelinFeb 7, 2018

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.