{"thread":{"id":"47760","subject":"[bug report]: error doing_rebase","startedAt":"2018-02-05T19:34:23Z","lastAt":"2018-02-07T14:12:12Z","messageCount":3,"participants":["Bulat Musin","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"338234","messageId":"d4246fa9-5ca2-33c9-d7b6-07adfd9b55a6@yandex.ru","threadId":"47760","inReplyTo":null,"subject":"[bug report]: error doing_rebase","fromName":"Bulat Musin","fromEmail":"mbulatka@yandex.ru","sentAt":"2018-02-05T19:26:57Z","receivedAt":"2018-02-05T19:34:23Z","isPatch":false,"sender":{"key":"mbulatka@yandex.ru","avatar":null},"body":"Hi.\n\nTo reproduce:\n\ngit init testrepo\n\ncd testrepo\n\necho 1 >> file\n\ngit add file\n\ngit commit -m'1'\n\necho 2 >> file\n\ngit add file\n\ngit commit -m'2'\n\necho 3 >> file\n\ngit add file\n\ngit commit -m'3'\n\nNow there are 3 sequential commits, I want to squash them into 1:\n\ngit rebase -i HEAD~2\n\nIn editor I changed all \"pick\" to \"squash\", saved file, I got:\n\nerror: cannot 'squash' without a previous commit\nYou can fix this with 'git rebase --edit-todo' and then run 'git rebase \n--continue'.\nOr you can abort the rebase with 'git rebase --abort'.\n\nHowever, 2.14.1 from Ubuntu's repo does the job - squashes 3 commits into 1.\n\nThanks.\n\n\n\n\ngit version 2.16.1.72.g5be1f00a9\n\n"},{"id":"338493","messageId":"nycvar.QRO.7.76.6.1802061045160.35@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"47760","inReplyTo":"d4246fa9-5ca2-33c9-d7b6-07adfd9b55a6@yandex.ru","subject":"Re: [bug report]: error doing_rebase","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-02-06T09:47:35Z","receivedAt":"2018-02-06T09:47:44Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 5 Feb 2018, Bulat Musin wrote:\n\n> Now there are 3 sequential commits, I want to squash them into 1:\n> \n> git rebase -i HEAD~2\n> \n> In editor I changed all \"pick\" to \"squash\", saved file, I got:\n> \n> error: cannot 'squash' without a previous commit\n\nYou cannot start with a squash. You have to pick the first one, then\nsquash the second into the first.\n\n> However, 2.14.1 from Ubuntu's repo does the job - squashes 3 commits into 1.\n\nIt may be careless enough to do that, however, it might now have modified\nthe *wrong* commit, i.e. squashed the two patches *into HEAD~2*.\n\nPlease verify that your HEAD~2 is still intact and part of the rebased\nhistory, otherwise you will have a problem.\n\nCiao,\nJohannes\n"},{"id":"338624","messageId":"nycvar.QRO.7.76.6.1802071500020.35@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"47760","inReplyTo":"0254c12c-e820-9c00-a4d0-2192fca76130@yandex.ru","subject":"Re: [bug report]: error doing_rebase","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-02-07T14:12:04Z","receivedAt":"2018-02-07T14:12:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Bulat,\n\nPlease make sure to keep the Git mailing list in Cc: (I get *very* prickly\nwhen Git users treat me as a free-of-cost help desk, and when I get that\nannoyed, I stop helping).\n\nOn Tue, 6 Feb 2018, Bulat Musin wrote:\n\n> Yes, I tested again.\n> \n> With built 2.16... and it shows error message. git rebase --abort restores\n> \n> state before rebase.\n\nYou misunderstood me. I am convinced that that error message *is correct*.\nIt shows an incorrect usage. You cannot start off an interactive rebase by\na `squash` command.\n\n> With git 2.14 from Ubuntu's repo it works - 3 commits are squashed into first\n> one\n\nYes, but you called `git rebase -i HEAD~2`, which means that only two\ncommits were up for rebasing. The third commit is outside the range\n`HEAD~2..` which the command `git rebase -i HEAD~2` wants to let you rebase.\n\nIf v2.14 indeed modified `HEAD~2` (as I suspected in my earlier mail),\nthen you successfully confirmed that we fixed a bug, and that you expected\nthe buggy behavior.\n\n> - with change SHA.\n> \n> It seems to be bug in recent version.\n> \n> Should I provide additional information?\n\nCiao,\nJohannes\n\n> On 02/06/2018 12:47 PM, Johannes Schindelin wrote:\n> > Hi,\n> >\n> > On Mon, 5 Feb 2018, Bulat Musin wrote:\n> >\n> > > Now there are 3 sequential commits, I want to squash them into 1:\n> > >\n> > > git rebase -i HEAD~2\n> > >\n> > > In editor I changed all \"pick\" to \"squash\", saved file, I got:\n> > >\n> > > error: cannot 'squash' without a previous commit\n> > You cannot start with a squash. You have to pick the first one, then\n> > squash the second into the first.\n> >\n> > > However, 2.14.1 from Ubuntu's repo does the job - squashes 3 commits into\n> > > 1.\n> > It may be careless enough to do that, however, it might now have modified\n> > the *wrong* commit, i.e. squashed the two patches *into HEAD~2*.\n> >\n> > Please verify that your HEAD~2 is still intact and part of the rebased\n> > history, otherwise you will have a problem.\n> >\n> > Ciao,\n> > Johannes\n> \n> \n"}]}