{"thread":{"id":"35616","subject":"[BUG] rebase --onto doesn't abort properly","startedAt":"2014-01-06T17:42:01Z","lastAt":"2014-01-06T18:55:07Z","messageCount":3,"participants":["Ramkumar Ramachandra","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"232738","messageId":"CALkWK0mEN=LjWKKdWznCXk5YwRQXVDPwtxUvVJnrG9zPPvH-Rw@mail.gmail.com","threadId":"35616","inReplyTo":null,"subject":"[BUG] rebase --onto doesn't abort properly","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2014-01-06T17:42:01Z","receivedAt":"2014-01-06T17:42:01Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nOn the latest git, I noticed that a rebase --onto doesn't abort\nproperly. Steps to reproduce:\n\n  # on some topic branch\n  $ git rebase --onto master @~10\n  ^C # quickly!\n  $ git rebase --abort\n  # HEAD is still detached\n\nI tried going back a few revisions, and the bug seems to be very old;\nI'm surprised I didn't notice it earlier.\n\nAre others able to reproduce this?\n\nThanks.\n\nRam\n"},{"id":"232747","messageId":"xmqqha9hhrvz.fsf@gitster.dls.corp.google.com","threadId":"35616","inReplyTo":"CALkWK0mEN=LjWKKdWznCXk5YwRQXVDPwtxUvVJnrG9zPPvH-Rw@mail.gmail.com","subject":"Re: [BUG] rebase --onto doesn't abort properly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-06T18:44:32Z","receivedAt":"2014-01-06T18:44:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Hi,\n>\n> On the latest git, I noticed that a rebase --onto doesn't abort\n> properly. Steps to reproduce:\n>\n>   # on some topic branch\n>   $ git rebase --onto master @~10\n>   ^C # quickly!\n>   $ git rebase --abort\n>   # HEAD is still detached\n\nI do not think --abort was designed to abort an uncontrolled stop\nlike ^C in the first place.  To allow that kind of \"recovery\", you\nneed to teach \"rebase\" to first record the state you would want to\ngo back to before doing anything, but then what happens if the ^C\ncomes when you are still in the middle of doing so?\n"},{"id":"232749","messageId":"CALkWK0=a-jh_r0c-hYstyVAatfF4nwBk3uYQ6RX+0=8VsPasVQ@mail.gmail.com","threadId":"35616","inReplyTo":"xmqqha9hhrvz.fsf@gitster.dls.corp.google.com","subject":"Re: [BUG] rebase --onto doesn't abort properly","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2014-01-06T18:55:07Z","receivedAt":"2014-01-06T18:55:07Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> I do not think --abort was designed to abort an uncontrolled stop\n> like ^C in the first place.\n\nWhy not? All it requires is a reset --hard to\n.git/rebase-apply/head-name, as usual, no?\n\n> To allow that kind of \"recovery\", you\n> need to teach \"rebase\" to first record the state you would want to\n> go back to before doing anything, but then what happens if the ^C\n> comes when you are still in the middle of doing so?\n\nI'm a bit puzzled: doesn't rebase write_basic_state() as soon as it\nstarts? It's true that we can't recover from a ^C before that, but I\nwould expect to be able to recover after a ^C somewhere in the middle.\n"}]}