{"thread":{"id":"31044","subject":"git rebase -i does not rebase if all lines are removed","startedAt":"2012-07-17T10:46:10Z","lastAt":"2012-07-17T12:25:15Z","messageCount":3,"participants":["Orgad and Raizel Shaneh","Carlos Martín Nieto","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"195198","messageId":"CAGHpTBKn+avCrWegktoJRurG+oycq6Sb9CiRDCBQG=hSMUkjiA@mail.gmail.com","threadId":"31044","inReplyTo":null,"subject":"git rebase -i does not rebase if all lines are removed","fromName":"Orgad and Raizel Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2012-07-17T10:46:10Z","receivedAt":"2012-07-17T10:46:10Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"Make a commit on top of master.\n\ngit rebase -i origin/master\n\nRemove the commit.\n\nGit prints \"Nothing to do\" and does not rebase.\n\nRunning 'git rebase -i' when there are no local commits has 'noop' in\nthe first line, and with it the rebase is successful. Why is this\n'noop' mandatory?\n\n- Orgad\n"},{"id":"195199","messageId":"1342522535.20671.7.camel@centaur.cmartin.tk","threadId":"31044","inReplyTo":"CAGHpTBKn+avCrWegktoJRurG+oycq6Sb9CiRDCBQG=hSMUkjiA@mail.gmail.com","subject":"Re: git rebase -i does not rebase if all lines are removed","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2012-07-17T10:55:35Z","receivedAt":"2012-07-17T10:55:35Z","isPatch":false,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On Tue, 2012-07-17 at 13:46 +0300, Orgad and Raizel Shaneh wrote:\n> Make a commit on top of master.\n> \n> git rebase -i origin/master\n> \n> Remove the commit.\n> \n> Git prints \"Nothing to do\" and does not rebase.\n> \n> Running 'git rebase -i' when there are no local commits has 'noop' in\n> the first line, and with it the rebase is successful. Why is this\n> 'noop' mandatory?\n\nIf you read the instructions, the last line says\n\n    # However, if you remove everything, the rebase will be aborted\n\nso if you want to do a no-op, then you need to tell it. This is the same\nway you abort a commit, by providing it with an empty message.\n\nBut more important would be /why/ you feel that rebase -i is the tool\nyou should be using. If you'd like to move the branch pointer back,\nthat's what the reset command is for. rebase deals with moving commits\nfrom one base to another and optionally reordering, squashing or\nremoving some of them.\n\n   cmn\n"},{"id":"195201","messageId":"500559AB.9000304@viscovery.net","threadId":"31044","inReplyTo":"1342522535.20671.7.camel@centaur.cmartin.tk","subject":"Re: git rebase -i does not rebase if all lines are removed","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-07-17T12:25:15Z","receivedAt":"2012-07-17T12:25:15Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 7/17/2012 12:55, schrieb Carlos Martín Nieto:\n> But more important would be /why/ you feel that rebase -i is the tool\n> you should be using. If you'd like to move the branch pointer back,\n> that's what the reset command is for.\n\nPerhaps because that's not what the OP wanted to do?\n\nSometimes it happens that you rebase a bunch of commits, and only a\nhandful remains because the others are already in upstream. Looking at\neach remaining one closely, you decide that they don't have to be rebased\n(maybe because slightly modified versions are in upstream), so you remove\nthem one by one, and you end up with an empty list.\n\nThis has happened to me at one point, and writing \"noop\" after the list is\nempty is a minor nuisance. But I am not complaining. Because being able to\nabort an interactive rebase by clearing the list is much more important.\n\n-- Hannes\n"}]}