{"thread":{"id":"34690","subject":"Possible git bug","startedAt":"2013-08-14T04:50:50Z","lastAt":"2013-08-14T06:53:40Z","messageCount":3,"participants":["Hugh Davenport","Daniel Knittl-Frank","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"225175","messageId":"9c9e5ea8a9d7e8ef37201cfb8ca9dcc3@davenport.net.nz","threadId":"34690","inReplyTo":null,"subject":"Possible git bug","fromName":"Hugh Davenport","fromEmail":"hugh@davenport.net.nz","sentAt":"2013-08-14T04:50:50Z","receivedAt":"2013-08-14T04:50:50Z","isPatch":false,"sender":{"key":"hugh@davenport.net.nz","avatar":"https://gravatar.com/avatar/8d2eb4ccc8a7759fd2717289353736bfd9b5d963e629b0e1b231be2c7a090c74?d=mp&s=160"},"body":"Hey,\n\nNot sure if this is a bug or not. I commonly am finding myself wanting \nto\nremove some recent commits, either all or just a select few. So I use \nrebase\nin interactive mode for this. The problem I find is that when I do a \nrebase\nand leave no commits to pick (where I would think that this would do the \nsame\nas a reset --hard) just tells me that there is nothing to be done.\n\nSo would that be a bug? Or maybe a feature? I would like it that when \nyou do\na rebase and select no commits, it will rebase ontop of the commit you \nchose,\nand remove all the commits not shown in the interactive listing (so \nall).\n\nAny ideas are welcome.\n\nCheers,\n\nHugh\n"},{"id":"225176","messageId":"CACx-yZ3Ba2vU4Jhjdtp1Ko=VjwarDkdHtN7ZFCzrU9Pz7-+S_Q@mail.gmail.com","threadId":"34690","inReplyTo":"9c9e5ea8a9d7e8ef37201cfb8ca9dcc3@davenport.net.nz","subject":"Re: Possible git bug","fromName":"Daniel Knittl-Frank","fromEmail":"knittl89@googlemail.com","sentAt":"2013-08-14T05:42:11Z","receivedAt":"2013-08-14T05:42:11Z","isPatch":false,"sender":{"key":"knittl89@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/2149217?v=4"},"body":"On Wed, Aug 14, 2013 at 6:50 AM, Hugh Davenport <hugh@davenport.net.nz> wrote:\n> Hey,\n>\n> Not sure if this is a bug or not. I commonly am finding myself wanting to\n> remove some recent commits, either all or just a select few. So I use rebase\n> in interactive mode for this. The problem I find is that when I do a rebase\n> and leave no commits to pick (where I would think that this would do the\n> same\n> as a reset --hard) just tells me that there is nothing to be done.\n\nThis is left as a way to abort a rebase if you change your mind just\nbefore actually executing it. This also works parallel to committing\nwith an empty commit message.\n\n> So would that be a bug? Or maybe a feature? I would like it that when you do\n> a rebase and select no commits, it will rebase ontop of the commit you\n> chose,\n> and remove all the commits not shown in the interactive listing (so all).\n\nYou can just use `git reset --hard <commit to rollback to>`  to\ndiscard all commits after the given commit (Unless they're part of\nanother branch, of course). `git reset --soft` if you want to keep the\nstate of your current working directory.\n\nCheers,\nDaniel\n\n-- \ntyped with http://neo-layout.org\n"},{"id":"225179","messageId":"20130814065339.GA3744@sigill.intra.peff.net","threadId":"34690","inReplyTo":"CACx-yZ3Ba2vU4Jhjdtp1Ko=VjwarDkdHtN7ZFCzrU9Pz7-+S_Q@mail.gmail.com","subject":"Re: Possible git bug","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-08-14T06:53:40Z","receivedAt":"2013-08-14T06:53:40Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 14, 2013 at 07:42:11AM +0200, Daniel Knittl-Frank wrote:\n\n> > So would that be a bug? Or maybe a feature? I would like it that\n> > when you do a rebase and select no commits, it will rebase ontop of\n> > the commit you chose, and remove all the commits not shown in the\n> > interactive listing (so all).\n> \n> You can just use `git reset --hard <commit to rollback to>`  to\n> discard all commits after the given commit (Unless they're part of\n> another branch, of course). `git reset --soft` if you want to keep the\n> state of your current working directory.\n\nYou can also use a \"noop\" line in the rebase instruction list rather\nthan a completely blank list to mean \"yes, really, do not apply any\ncommits\".\n\n-Peff\n"}]}