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

[PATCH 0/2] Demonstrate and fix a rebase --autostash bug with dirty submodules

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 23, 2018, 19:57 UTC
Message-ID
<pull.56.git.gitgitgadget@gmail.com>

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.

Johannes Schindelin (2):
  rebase --autostash: demonstrate a problem with dirty submodules
  rebase --autostash: fix issue with dirty submodules
 builtin/rebase.c            |  2 +-
 t/t3420-rebase-autostash.sh | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
base-commit: 209f214ca4ae4e301fc32e59ab26f937082f3ea3
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-56%2Fdscho%2Ffix-built-in-rebase-autostash-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-56/dscho/fix-built-in-rebase-autostash-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/56
-- 
gitgitgadget
Next: Johannes Schindelin via GitGitGadget
Message 1 of 6 in “Demonstrate and fix a rebase --autostash bug with dirty submodules”
  1. 0/2 Demonstrate and fix a rebase --autostash bug with dirty submodulesJohannes Schindelin via GitGitGadget, Oct 23, 2018
  2. 1/2 rebase --autostash: demonstrate a problem with dirty submodulesJohannes Schindelin via GitGitGadget, Oct 23, 2018
  3. 2/2 rebase --autostash: fix issue with dirty submodulesJohannes Schindelin via GitGitGadget, Oct 23, 2018
  4. Regression in rebase-in-C with rebase.autoStash=trueÆvar Arnfjörð Bjarmason, Nov 6, 2018
  5. Jeff KingNov 6, 2018
  6. Johannes SchindelinNov 7, 2018

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.