git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Daniel Hahler <git@thequod.de>
Date
Jun 15, 2016, 21:56 UTC
Message-ID
<1b5e2f4b-7a3d-7554-3aa0-79231bee039e@thequod.de>
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.

Message 1 of 1 in “"git-rebase -i --autostash" will leave dangling stash when editor is aborted”
  1. Daniel HahlerJun 15, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.