threads / discuss / 42621

"git-rebase -i --autostash" will leave dangling stash when editor is aborted

Subject: "git-rebase -i --autostash" will leave dangling stash when editor is aborted

## tl;dr

One message between Jun 16, 2016 and Jun 16, 2016.

replies: 0people: 1as markdown or json

Daniel Hahler· Jun 15, 2016, 21:56 UTC · lore
TEST CASE:
1. Modify a file that need to get stashed on rebasing
2. Run "EDITOR=vim git rebase -i --autostash"
3. Abort with ":cq", which will make Vim exit non-zero

Git then will create an autostash, but aborts with "Could not execute editor", via the following code in git-rebase--interactive.sh, and does not restore the autostash - it does not show up with the regular stashes, like when there is a conflict during the rebase:

    git_sequence_editor "$todo" ||
        die_abort "Could not execute editor"

Step 2 and 3 and probably merged into a single one for a test case, but that's how I keep triggering it.

Instead of adding it to the list of stashes, it should probably get restored/re-applied right away, since no rebase actions have been triggered.

Please CC me in replies.

Cheers, Daniel.

← back to recent threads