diff mbox series

[v3] t3433: new rebase testcase documenting a stat-dirty-like failure

Message ID pull.712.v3.git.git.1582064105813.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v3] t3433: new rebase testcase documenting a stat-dirty-like failure | expand

Commit Message

Linus Arver via GitGitGadget Feb. 18, 2020, 10:15 p.m. UTC
From: Elijah Newren <newren@gmail.com>

A user discovered a case where they had a stack of 20 simple commits to
rebase, and the rebase would succeed in picking the first commit and
then error out with a pair of "Could not execute the todo command" and
"Your local changes to the following files would be overwritten by
merge" messages.

Their steps actually made use of the -i flag, but I switched it over to
-m to make it simpler to trigger the bug.  With that flag, it bisects
back to commit 68aa495b590d (rebase: implement --merge via the
interactive machinery, 2018-12-11), but that's misleading.  If you
change the -m flag to --keep-empty, then the problem persists and will
bisect back to 356ee4659bb5 (sequencer: try to commit without forking
'git commit', 2017-11-24)

After playing with the testcase for a bit, I discovered that added
--exec "sleep 1" to the command line makes the rebase succeed, making me
suspect there is some kind of discard and reloading of caches that lead
us to believe that something is stat dirty, but I didn't succeed in
digging any further than that.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
    t3433: new rebase testcase documenting a stat-dirty-like failure
    
    Rename to t3433 to avoid having two t3424 tests.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-712%2Fnewren%2Fdocument-rebase-failure-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-712/newren/document-rebase-failure-v3
Pull-Request: https://github.com/git/git/pull/712

Range-diff vs v2:

 1:  09085292596 ! 1:  270591cd3be t3424: new rebase testcase documenting a stat-dirty-like failure
     @@ -1,6 +1,6 @@
      Author: Elijah Newren <newren@gmail.com>
      
     -    t3424: new rebase testcase documenting a stat-dirty-like failure
     +    t3433: new rebase testcase documenting a stat-dirty-like failure
      
          A user discovered a case where they had a stack of 20 simple commits to
          rebase, and the rebase would succeed in picking the first commit and
     @@ -24,10 +24,10 @@
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
      
     - diff --git a/t/t3424-rebase-across-mode-change.sh b/t/t3424-rebase-across-mode-change.sh
     + diff --git a/t/t3433-rebase-across-mode-change.sh b/t/t3433-rebase-across-mode-change.sh
       new file mode 100755
       --- /dev/null
     - +++ b/t/t3424-rebase-across-mode-change.sh
     + +++ b/t/t3433-rebase-across-mode-change.sh
      @@
      +#!/bin/sh
      +


 t/t3433-rebase-across-mode-change.sh | 48 ++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100755 t/t3433-rebase-across-mode-change.sh


base-commit: e68e29171cc2d6968902e0654b5687fbe1ccb903
diff mbox series

Patch

diff --git a/t/t3433-rebase-across-mode-change.sh b/t/t3433-rebase-across-mode-change.sh
new file mode 100755
index 00000000000..f11fc35c3ee
--- /dev/null
+++ b/t/t3433-rebase-across-mode-change.sh
@@ -0,0 +1,48 @@ 
+#!/bin/sh
+
+test_description='git rebase across mode change'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	mkdir DS &&
+	>DS/whatever &&
+	git add DS &&
+	git commit -m base &&
+
+	git branch side1 &&
+	git branch side2 &&
+
+	git checkout side1 &&
+	git rm -rf DS &&
+	test_ln_s_add unrelated DS &&
+	git commit -m side1 &&
+
+	git checkout side2 &&
+	>unrelated &&
+	git add unrelated &&
+	git commit -m commit1 &&
+
+	echo >>unrelated &&
+	git commit -am commit2
+'
+
+test_expect_success 'rebase changes with the apply backend' '
+	test_when_finished "git rebase --abort || true" &&
+	git checkout -b apply-backend side2 &&
+	git rebase side1
+'
+
+test_expect_failure 'rebase changes with the merge backend' '
+	test_when_finished "git rebase --abort || true" &&
+	git checkout -b merge-backend side2 &&
+	git rebase -m side1
+'
+
+test_expect_success 'rebase changes with the merge backend with a delay' '
+	test_when_finished "git rebase --abort || true" &&
+	git checkout -b merge-delay-backend side2 &&
+	git rebase -m --exec "sleep 1" side1
+'
+
+test_done