Skip to content

Built-in rebase fails with 'Unexpected stash response' (MVCE included) #1876

Closed
@rcdailey

Description

@rcdailey

I get the following error when doing a rebase with a modified working copy (submodule modified) and with the configuration option rebase.autostash set to true:

$ git rebase --no-fork-point master
09:34:43.229716 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
09:34:43.230216 git.c:415               trace: built-in: git rebase --no-fork-point master
09:34:43.230216 run-command.c:637       trace: run_command: git config --bool rebase.usebuiltin
09:34:43.238724 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:34:43.239725 git.c:415               trace: built-in: git config --bool rebase.usebuiltin
09:34:43.249230 run-command.c:637       trace: run_command: git stash create autostash
09:34:43.263242 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:34:43.263742 git.c:415               trace: built-in: git stash create autostash
09:34:43.263742 run-command.c:637       trace: run_command: git config --bool stash.usebuiltin
09:34:43.274250 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:34:43.275251 git.c:415               trace: built-in: git config --bool stash.usebuiltin
fatal: Unexpected stash response: ''

Here is the MVCE (simple bash script you can run):

#!/usr/bin/env bash
set -o xtrace

git init mvce_stash_failure
pushd mvce_stash_failure
git config rebase.autostash true

# Add stuff to master
git init thesubmodule
pushd thesubmodule
echo submodule > submodulefile1
git add submodulefile1
git commit -m 'submodulefile1 added'
popd

git add thesubmodule
git commit -m 'added submodule'

echo value > file1
git add file1
git commit -m 'file1 added'

echo value > file2
git add file2
git commit -m 'file2 added'

# Add stuff to a feature branch
git checkout -b topic1 @^
echo value2 > file2
git add file2
git commit -m 'file2 added'

pushd thesubmodule
echo submodule > submodulefile2
git add submodulefile2
git commit -m 'submodulefile2 added'
popd

# This fails with: fatal: Unexpected stash response: ''
GIT_TRACE=1 git rebase --no-fork-point master

popd
rm -rf mvce_stash_failure

Using Git for Windows v2.19.1 with experimental built-in stash & rebase enabled via installer options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions