{"thread":{"id":"12191","subject":"rebase --onto might \"loose\" commits","startedAt":"2008-02-19T07:23:59Z","lastAt":"2008-02-19T14:43:15Z","messageCount":4,"participants":["Björn Steinbrink","Johannes Schindelin","Nicolas Pitre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"69238","messageId":"20080219072359.GA752@atjola.homenet","threadId":"12191","inReplyTo":null,"subject":"rebase --onto might \"loose\" commits","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-02-19T07:23:59Z","receivedAt":"2008-02-19T07:23:59Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"Hi,\n\nwhen there's nothing to rebase (ie. upstream..branch is empty), rebase\nfails to find any commits to rebase and correctly says \"Nothing to do\",\nbut when --onto is given, we already did a \"reset --hard\" to newbase, so\nit already _did_ something.\n\nAs rebase also shows a \"fatal: Not a range\", during the operation, I\nassume that this is an actual bug and not just a plain user error.\n\nA test script is attached.\n\nThank,\nBjörn\n"},{"id":"69250","messageId":"alpine.LSU.1.00.0802191102440.30505@racer.site","threadId":"12191","inReplyTo":"20080219072359.GA752@atjola.homenet","subject":"Re: rebase --onto might \"loose\" commits","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-19T11:05:40Z","receivedAt":"2008-02-19T11:05:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 19 Feb 2008, Björn Steinbrink wrote:\n\n> when there's nothing to rebase (ie. upstream..branch is empty), rebase \n> fails to find any commits to rebase and correctly says \"Nothing to do\", \n> but when --onto is given, we already did a \"reset --hard\" to newbase, so \n> it already _did_ something.\n\nYes, it did something.  But if you had that:\n\nA - B - C - D - E\n  \\\n    F\n\nyour HEAD was E, and you said \"git rebase --onto F E\" what exactly do you \nwant it to do?  There is no commit between E and E, so it rebases \n_nothing_ onto F.  Which means that F should be your new state.\n\nUnless I am missing something critical in your mail.\n\n> As rebase also shows a \"fatal: Not a range\", during the operation, I \n> assume that this is an actual bug and not just a plain user error.\n\nThat message is probably a bug, then.\n\nCiao,\nDscho\n\nP.S.: I was being corrected some time ago on the same typo: \"to lose\" \nmeans to get rid of something unintentionally, \"to loose\" does not exist, \nand \"to loosen\" means to make something less tight."},{"id":"69252","messageId":"20080219125216.GA10444@atjola.homenet","threadId":"12191","inReplyTo":"alpine.LSU.1.00.0802191102440.30505@racer.site","subject":"Re: rebase --onto might \"loose\" commits","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-02-19T12:52:16Z","receivedAt":"2008-02-19T12:52:16Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"Hi,\n\nOn 2008.02.19 11:05:40 +0000, Johannes Schindelin wrote:\n> On Tue, 19 Feb 2008, Björn Steinbrink wrote:\n> \n> > when there's nothing to rebase (ie. upstream..branch is empty), rebase \n> > fails to find any commits to rebase and correctly says \"Nothing to do\", \n> > but when --onto is given, we already did a \"reset --hard\" to newbase, so \n> > it already _did_ something.\n> \n> Yes, it did something.  But if you had that:\n> \n> A - B - C - D - E\n>   \\\n>     F\n> \n> your HEAD was E, and you said \"git rebase --onto F E\" what exactly do you\n> want it to do?  There is no commit between E and E, so it rebases\n> _nothing_ onto F.  Which means that F should be your new state.\n\nStrictly, it's correct, but the \"Nothing to do\" message is a bit\nmisleading (IMHO) and the error message made me think, that it actually\ndidn't want to do anything.\n\nI'm a bit unsure about rebase being degraded to a \"reset --hard\" in this\ncase is a good idea. Might be a nice user-protection to make rebase\nabort when there's nothing to rebase and --onto is given. But I don't\ncare that much.\n\nThanks,\nBjörn\n\n> P.S.: I was being corrected some time ago on the same typo: \"to lose\" \n> means to get rid of something unintentionally, \"to loose\" does not exist, \n> and \"to loosen\" means to make something less tight.\n\nAh yeah, one of my preferred typos. There's about a 50% chance for me to\nget that right. Although it already felt wrong when I read over the\nmail, for some unknown reason I couldn't put my finger on the typo. ;-)\n"},{"id":"69269","messageId":"alpine.LFD.1.00.0802190939240.2732@xanadu.home","threadId":"12191","inReplyTo":"20080219125216.GA10444@atjola.homenet","subject":"Re: rebase --onto might \"loose\" commits","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2008-02-19T14:43:15Z","receivedAt":"2008-02-19T14:43:15Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 19 Feb 2008, Björn Steinbrink wrote:\n\n> Hi,\n> \n> On 2008.02.19 11:05:40 +0000, Johannes Schindelin wrote:\n> > On Tue, 19 Feb 2008, Björn Steinbrink wrote:\n> > \n> > > when there's nothing to rebase (ie. upstream..branch is empty), rebase \n> > > fails to find any commits to rebase and correctly says \"Nothing to do\", \n> > > but when --onto is given, we already did a \"reset --hard\" to newbase, so \n> > > it already _did_ something.\n> > \n> > Yes, it did something.  But if you had that:\n> > \n> > A - B - C - D - E\n> >   \\\n> >     F\n> > \n> > your HEAD was E, and you said \"git rebase --onto F E\" what exactly do you\n> > want it to do?  There is no commit between E and E, so it rebases\n> > _nothing_ onto F.  Which means that F should be your new state.\n> \n> Strictly, it's correct, but the \"Nothing to do\" message is a bit\n> misleading (IMHO) and the error message made me think, that it actually\n> didn't want to do anything.\n\nYes, the message should probably be changed in that case.\n\n> I'm a bit unsure about rebase being degraded to a \"reset --hard\" in this\n> case is a good idea. Might be a nice user-protection to make rebase\n> abort when there's nothing to rebase and --onto is given. But I don't\n> care that much.\n\nThe \"reset --hard\" in that case is really the correct behavior.  Rebase \nmight be used like 'git pull --rebase', and if your local branch \ncontains no commits of your own then the 'git reset --hard' is really \nwhat needs to happen.\n\nThe \"user protection\" lives in the reflog.\n\n\nNicolas\n"}]}