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

Re: Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 3, 2017, 16:06 UTC
Message-ID
<alpine.DEB.2.21.1.1711031658190.6482@virtualbox>
In-Reply-To
<CAGHpTBJTm=3f_VCnNLeE=V4CwvC6dM8qCmGRPDap6rszcpb65A@mail.gmail.com>
Hi Orgad,
On Thu, 2 Nov 2017, Orgad Shaneh wrote:
Show 22 quoted lines
> I can't reproduce this with a minimal example, but it happens in my project.
> 
> What I tried to do for reproducing is:
> rm -rf super sub
> mkdir sub; cd sub; git init
> git commit --allow-empty -m 'Initial commit'
> mkdir ../super; cd ../super
> git init
> git submodule add ../sub
> touch foo; git add foo sub
> git commit -m 'Initial commit'
> touch a; git add a; git commit -m 'a'
> touch b; git add b; git commit -m 'b'
> cd sub; git commit --allow-empty -m 'New commit'; cd ..
> git rebase -i HEAD^^
> 
> Then drop a.
> 
> In my project I get:
> error: cannot rebase: You have unstaged changes.
> 
> This works fine with 2.14.3.
I tried to turn this into a regression test, but I cannot make it fail:
-- snip --
diff --git a/t/t3426-rebase-submodule.sh b/t/t3426-rebase-submodule.sh
index ebf4f5e4b2c..55aebe53191 100755
--- a/t/t3426-rebase-submodule.sh
+++ b/t/t3426-rebase-submodule.sh
@@ -20,7 +20,7 @@ git_rebase () {
 	git rebase "$1"
 }
 
-test_submodule_switch "git_rebase"
+#test_submodule_switch "git_rebase"
 
 git_rebase_interactive () {
 	git status -su >expect &&
@@ -38,6 +38,27 @@ git_rebase_interactive () {
 	git rebase -i "$1"
 }
 
-test_submodule_switch "git_rebase_interactive"
+#test_submodule_switch "git_rebase_interactive"
+
+test_expect_success '123' '
+	git init sub &&
+	test_commit -C sub init-submodule &&
+	git init super &&
+	git -C super submodule add ../sub &&
+	(
+		cd super &&
+		test_tick &&
+		touch foo &&
+		git add sub foo &&
+		git commit -m initial &&
+		test_commit a &&
+		test_commit b &&
+		test_commit -C sub new &&
+		set_fake_editor &&
+		FAKE_LINES=2 &&
+		export FAKE_LINES &&
+		git rebase -i HEAD^^
+	)
+'
 
 test_done
-- snap --

Can you help me spot what I did wrong?

Ciao,
Dscho
Previous: Orgad ShanehNext: Johannes Schindelin
Message 4 of 9 in “Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified”
  1. Orgad ShanehNov 2, 2017
  2. Stefan BellerNov 2, 2017
  3. Orgad ShanehNov 2, 2017
  4. Johannes SchindelinNov 3, 2017
  5. Johannes SchindelinNov 3, 2017
  6. Orgad ShanehNov 4, 2017
  7. Orgad ShanehNov 5, 2017
  8. Brandon WilliamsNov 6, 2017
  9. Orgad ShanehNov 6, 2017

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.