Skip to content

Conversation

dscho
Copy link
Member

@dscho dscho commented Oct 23, 2018

This bug report came in via Git for Windows (already with version 2.19.0, but I misread the reporter's enthusiasm to take matters into his own hands).

The culprit is, in a nutshell, that the built-in rebase tries to run git stash only when the worktree is dirty, but it includes submodules in that. However, git stash cannot do anything about submodules, and if the only changes are in submodules, then it won't even give us back an OID, and the built-in rebase acts surprised.

The solution is easy: simply exclude the submodules from the question whether the worktree is dirty.

What is surprisingly not simple is to get the regression test right. For that reason, and because I firmly believe that it is easier to verify a fix for a regression when the regression test is introduced separately (i.e. making it simple to verify that there is a regression), I really want to keep the first patch separate from the second one.

Since this bug concerns the built-in rebase, I based the patches on top of next.

dscho added 2 commits October 23, 2018 21:18
It has been reported that dirty submodules cause problems with the
built-in rebase when it is asked to autostash. The symptom is:

	fatal: Unexpected stash response: ''

This patch adds a regression test that demonstrates that bug.

Original report: git-for-windows#1820

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Since we cannot stash dirty submodules, there is no use in requiring
them to be clean (or stash them when they are not).

This brings the built-in rebase in line with the previous, scripted
version, which also did not care about dirty submodules (but it was
admittedly not very easy to figure that out).

This fixes git-for-windows#1820

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho changed the title Fix built in rebase autostash Demonstrate and fix a rebase --autostash bug with dirty submodules Oct 23, 2018
@dscho
Copy link
Member Author

dscho commented Oct 23, 2018

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 23, 2018

Submitted as pull.56.git.gitgitgadget@gmail.com

@dscho
Copy link
Member Author

dscho commented Nov 5, 2018

Integrated into master via git@297eab4

@dscho dscho closed this Nov 5, 2018
@dscho dscho deleted the fix-built-in-rebase-autostash branch November 5, 2018 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant