{"thread":{"id":"47689","subject":"Bug, git rebase -i does not abort correctly","startedAt":"2018-01-25T12:14:33Z","lastAt":"2018-03-13T18:26:17Z","messageCount":4,"participants":["Duy Nguyen","Kaartic Sivaraam"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"337365","messageId":"CACsJy8Dzh5E8JUDkwFmYTwS6KgqGc_1rJBVsDCoC9EpcSShN2Q@mail.gmail.com","threadId":"47689","inReplyTo":null,"subject":"Bug, git rebase -i does not abort correctly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-01-25T12:13:58Z","receivedAt":"2018-01-25T12:14:33Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"rebase scripts are too much for me, so I'll play the user reporting\nbugs this time :)\n\nInstead of doing\n\n    $ git rebase -i --onto origin/master @~3\n\nI sometimes accidentally type\n\n    $ git rebase -i origin/master @~3\n\n(\"rebase -i\" is actually an alias, which is why I never forget to type -i)\n\nUsually the todo list in $EDITOR shows noop, I realize my mistake and\ntry to abort it by clearing the todo list before saving and closing\n$EDITOR. The problem is, HEAD is moved away anyway (to origin/master I\nthink) even if rebase is supposed to abort the operation and leave\nHEAD untouched.\n-- \nDuy\n"},{"id":"337453","messageId":"1516953056.8886.3.camel@gmail.com","threadId":"47689","inReplyTo":"CACsJy8Dzh5E8JUDkwFmYTwS6KgqGc_1rJBVsDCoC9EpcSShN2Q@mail.gmail.com","subject":"Re: Bug, git rebase -i does not abort correctly","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-01-26T07:50:56Z","receivedAt":"2018-01-26T07:51:10Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hi,\n\nOn Thursday 25 January 2018 05:43 PM, Duy Nguyen wrote:\n> rebase scripts are too much for me, so I'll play the user reporting\n> bugs this time :)\n> \n> Instead of doing\n> \n>     $ git rebase -i --onto origin/master @~3\n> \n> I sometimes accidentally type\n> \n>     $ git rebase -i origin/master @~3\n> \n> (\"rebase -i\" is actually an alias, which is why I never forget to\ntype -i)\n> \n> Usually the todo list in $EDITOR shows noop, I realize my mistake and\n> try to abort it by clearing the todo list before saving and closing\n> $EDITOR. The problem is, HEAD is moved away anyway (to origin/master\nI\n> think) \n\nFor me it left HEAD at @~3. Reading the synopsis of `man git rebase` I\ncould guess that the corresponding abstract form would be,\n\n    $ git rebase -i <upstream> <branch>\n\n\n> even if rebase is supposed to abort the operation and leave\n> HEAD untouched.\n> \n\nThis might seem to be a bug as the comment in \"git-rebase-todo\" says,\n\n    However, if you remove everything, the rebase will be aborted.\n\nBut \"man git rebase\" clearly says,\n\n    If <branch> is specified, git rebase will perform an automatic \"git\n    checkout <branch>\" before doing anything else. Otherwise it remains\n    on\n    the current branch.\n\nJunio has previously confirmed that \"git rebase [-i] <upstream>\n<branch>\" is just a short hand for \"git checkout <branch> && git rebase\n[-i] <upstream>\".[ref 1] So, it's not surprising that it left HEAD at\n@~3 when you completely removed the contents of git-rebase-todo and\nexited the editor.\n\nDoes that help solve your issue?\n\n\n[ref 1]: \n\nhttps://public-inbox.org/git/%3Cxmqqpo8387hz.fsf@gitster.mtv.corp.google.com%3E\n\n-- \nKaartic\n\nQUOTE\n\n“It is impossible to live without failing at something, unless you live\nso cautiously that you might as well not have lived at all – in which\ncase, you fail by default.”\n\n      - J. K. Rowling\n\n\nWIKIPEDIA: DID YOU KNOW?\n\nOnly 33% of internet users in India have heard of Wikipedia !!\n\n* What do you think could be the reason behind this?\n\n* What are ways in which the awareness about Wikipedia in India and\nother countries be increased ?\n\nReference:\n\n* Give your ideas for increasing the awareness of Wikipedia in India\nand\nin other countries and get a Grant from the Wikimedia Foundation to\nbring your idea to life.\n\n  https://meta.wikimedia.org/wiki/Grants:IdeaLab/Inspire\n\n* Know more about the awareness problem of Wikipedia\n\n  https://meta.wikimedia.org/wiki/New_Readers/Awareness\n\n  https://meta.wikimedia.org/wiki/New_Readers/Next_steps/Raising_awareness\n-- \nKaartic\n\nHi,\n\nI seem to able to reproduce your issue. More comments inline.\n\nOn Thursday 25 January 2018 05:43 PM, Duy Nguyen wrote:\n> rebase scripts are too much for me, so I'll play the user reporting\n> bugs this time :)\n> \n> Instead of doing\n> \n>     $ git rebase -i --onto origin/master @~3\n> \n> I sometimes accidentally type\n> \n>     $ git rebase -i origin/master @~3\n> \n> (\"rebase -i\" is actually an alias, which is why I never forget to type -i)\n> \n> Usually the todo list in $EDITOR shows noop, I realize my mistake and\n> try to abort it by clearing the todo list before saving and closing\n> $EDITOR. The problem is, HEAD is moved away anyway (to origin/master I\n> think) \n\nFor me it left HEAD at @~3. Reading the synopsis of `man git rebase` I\ncould guess that the corresponding abstract form would be,\n\n    $ git rebase -i <upstream> <branch>\n\n\n> even if rebase is supposed to abort the operation and leave\n> HEAD untouched.\n> \n\nThis might seem to be a bug as the comment in \"git-rebase-todo\" says,\n\n    However, if you remove everything, the rebase will be aborted.\n\nBut \"man git rebase\" clearly says,\n\n    If <branch> is specified, git rebase will perform an automatic git\ncheckout <branch> before doing anything else. Otherwise it remains on\n       the current branch.\nSurprisingly when git-rebase-todo's content is only a \"noop\" just\nclosing the editor without removing the contents also seems to be lying\nas it checks\n-- \nKaartic\n\nQUOTE\n\n“It is impossible to live without failing at something, unless you live\nso cautiously that you might as well not have lived at all – in which\ncase, you fail by default.”\n\n      - J. K. Rowling\n\n\nWIKIPEDIA: DID YOU KNOW?\n\nOnly 33% of internet users in India have heard of Wikipedia !!\n\n* What do you think could be the reason behind this?\n\n* What are ways in which the awareness about Wikipedia in India and\nother countries be increased ?\n\nReference:\n\n* Give your ideas for increasing the awareness of Wikipedia in India and\nin other countries and get a Grant from the Wikimedia Foundation to\nbring your idea to life.\n\n  https://meta.wikimedia.org/wiki/Grants:IdeaLab/Inspire\n\n* Know more about the awareness problem of Wikipedia\n\n  https://meta.wikimedia.org/wiki/New_Readers/Awareness\n\n  https://meta.wikimedia.org/wiki/New_Readers/Next_steps/Raising_awareness\n"},{"id":"337454","messageId":"CACsJy8DjXBv_HMbRFPjCLuYt-bk=Ec3VPKorXJ_SBJN8pDu=PQ@mail.gmail.com","threadId":"47689","inReplyTo":"1516953056.8886.3.camel@gmail.com","subject":"Re: Bug, git rebase -i does not abort correctly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-01-26T09:24:58Z","receivedAt":"2018-01-26T09:25:38Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Jan 26, 2018 at 2:50 PM, Kaartic Sivaraam\n<kaartic.sivaraam@gmail.com> wrote:\n> This might seem to be a bug as the comment in \"git-rebase-todo\" says,\n>\n>     However, if you remove everything, the rebase will be aborted.\n>\n> But \"man git rebase\" clearly says,\n>\n>     If <branch> is specified, git rebase will perform an automatic \"git\n>     checkout <branch>\" before doing anything else. Otherwise it remains\n>     on\n>     the current branch.\n>\n> Junio has previously confirmed that \"git rebase [-i] <upstream>\n> <branch>\" is just a short hand for \"git checkout <branch> && git rebase\n> [-i] <upstream>\".[ref 1] So, it's not surprising that it left HEAD at\n> @~3 when you completely removed the contents of git-rebase-todo and\n> exited the editor.\n>\n> Does that help solve your issue?\n\nSort of. It smells bad design to me when a mistake can easily become a\nfeature. But with your help, I think I should be able to disable this\nfeature on my local build. Thanks.\n-- \nDuy\n"},{"id":"341564","messageId":"4305648a-9579-b961-6435-dde9c6fd3ba1@gmail.com","threadId":"47689","inReplyTo":"CACsJy8DjXBv_HMbRFPjCLuYt-bk=Ec3VPKorXJ_SBJN8pDu=PQ@mail.gmail.com","subject":"Re: Bug, git rebase -i does not abort correctly","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-03-13T18:26:05Z","receivedAt":"2018-03-13T18:26:17Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Friday 26 January 2018 02:54 PM, Duy Nguyen wrote:\n> \n> Sort of. It smells bad design to me when a mistake can easily become a\n> feature. But with your help, I think I should be able to disable this\n> feature on my local build. Thanks.\n> \n\nIn case you're still facing this issue, it just struck me recently that\nyou could have a different alias for 'git rebase -i --onto'. In which\ncase you could possibly avoid falling prey to the syntax issue ;-)\nSomething like,\n\n\t$ git config alias.rio 'rebase -i --onto'\n\n\n\n-- \nKaartic\n\nQUOTE\n---\n\n“The most valuable person on any team is the person who makes everyone\nelse on the team more valuable, not the person who knows the most.”\n\n      - Joel Spolsky\n\n"}]}