{"thread":{"id":"42946","subject":"Bug? git rebase -i --autostash fails to restore working files","startedAt":"2016-07-28T11:06:24Z","lastAt":"2016-07-28T17:29:57Z","messageCount":3,"participants":["Phillip Wood","Remi Galan Alfonso"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"292394","messageId":"222a3e5b-ff2c-799e-0fcb-cba23815019f@talktalk.net","threadId":"42946","inReplyTo":null,"subject":"Bug? git rebase -i --autostash fails to restore working files","fromName":"Phillip Wood","fromEmail":"phillip.wood@talktalk.net","sentAt":"2016-07-28T10:58:07Z","receivedAt":"2016-07-28T11:06:24Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"When running ‘git rebase -i --autostash’ if the editor fails then the\nrebase fails but stash is not applied so the working files are not\nrestored. Running ‘git rebase --abort’ replies that there’s no rebase\nin progress. If you notice what’s happened it’s not a problem if you\nknow to do ‘git stash apply <autostash id>’ but it’s confusing as\nnormally the stash would be automatically applied. This happened to me\nwhen I messed up my editor configuration but you can reproduce it with\n\n$ GIT_SEQUENCE_EDITOR=false git rebase -i --autostash HEAD^^\nCreated autostash: ff960d4\nHEAD is now at f1b8af7 [git] Turn on rebase.missingCommitsCheck\nCould not execute editor\n\n$ git rebase --abort\nNo rebase in progress?\n\nBest Wishes\n\nPhillip\n"},{"id":"292398","messageId":"568300231.1133609.1469710974063.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"42946","inReplyTo":"222a3e5b-ff2c-799e-0fcb-cba23815019f@talktalk.net","subject":"Re: Bug? git rebase -i --autostash fails to restore working files","fromName":"Remi Galan Alfonso","fromEmail":"remi.galan-alfonso@ensimag.grenoble-inp.fr","sentAt":"2016-07-28T13:02:54Z","receivedAt":"2016-07-28T12:44:29Z","isPatch":false,"sender":{"key":"remi.galan-alfonso@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12509162?v=4"},"body":"Hi Phillip,\n\nPhillip Wood <phillip.wood@talktalk.net> writes:\n> When running ‘git rebase -i --autostash’ if the editor fails then the\n> rebase fails but stash is not applied so the working files are not\n> restored. Running ‘git rebase --abort’ replies that there’s no rebase\n> in progress. If you notice what’s happened it’s not a problem if you\n> know to do ‘git stash apply <autostash id>’ but it’s confusing as\n> normally the stash would be automatically applied. This happened to me\n> when I messed up my editor configuration but you can reproduce it with\n> \n> $ GIT_SEQUENCE_EDITOR=false git rebase -i --autostash HEAD^^\n> Created autostash: ff960d4\n> HEAD is now at f1b8af7 [git] Turn on rebase.missingCommitsCheck\n\n[I'm happy to see rebase.missingCommitsCheck being used.]\n\n> Could not execute editor\n> \n> $ git rebase --abort\n> No rebase in progress?\n\nI remembered having read something about it recently and a quick\nsearch confirmed it. It was corrected in commit 33ba9c6 (29/06/2016,\nrebase -i: restore autostash on abort) that recently graduated to\nmaster (on 19/07/2016 if I read the various \"What's cooking\"\ncorrectly). So you will need to build git from source to have this\ncorrected.\n\n> Best Wishes\n> \n> Phillip\n\nThanks,\nRémi\n"},{"id":"292434","messageId":"595ec1d8-a759-e2cf-b387-a68bd6c0a437@talktalk.net","threadId":"42946","inReplyTo":"568300231.1133609.1469710974063.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: Bug? git rebase -i --autostash fails to restore working files","fromName":"Phillip Wood","fromEmail":"phillip.wood@talktalk.net","sentAt":"2016-07-28T17:29:49Z","receivedAt":"2016-07-28T17:29:57Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 28/07/16 14:02, Remi Galan Alfonso wrote:\n> Hi Phillip,\n> \n> Phillip Wood <phillip.wood@talktalk.net> writes:\n>> When running ‘git rebase -i --autostash’ if the editor fails then the\n>> rebase fails but stash is not applied so the working files are not\n>> restored. Running ‘git rebase --abort’ replies that there’s no rebase\n>> in progress. If you notice what’s happened it’s not a problem if you\n>> know to do ‘git stash apply <autostash id>’ but it’s confusing as\n>> normally the stash would be automatically applied. This happened to me\n>> when I messed up my editor configuration but you can reproduce it with\n>>\n>> $ GIT_SEQUENCE_EDITOR=false git rebase -i --autostash HEAD^^\n>> Created autostash: ff960d4\n>> HEAD is now at f1b8af7 [git] Turn on rebase.missingCommitsCheck\n> \n> [I'm happy to see rebase.missingCommitsCheck being used.]\n> \n>> Could not execute editor\n>>\n>> $ git rebase --abort\n>> No rebase in progress?\n> \n> I remembered having read something about it recently and a quick\n> search confirmed it. It was corrected in commit 33ba9c6 (29/06/2016,\n> rebase -i: restore autostash on abort) that recently graduated to\n> master (on 19/07/2016 if I read the various \"What's cooking\"\n> correctly). So you will need to build git from source to have this\n> corrected.\n\nHi Rémi\n\nThanks for the reply, it's good to know it's been fixed.\n\nBest Wishes\n\nPhillip\n\n"}]}