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

[PATCH 3/3] rebase: Add tests for console output with conflicting stash

From
PWPhillip Wood <phillip.wood@talktalk.net>
Date
May 31, 2017, 10:42 UTC
Message-ID
<20170531104213.16944-4-phillip.wood@talktalk.net>
In-Reply-To
<20170531104213.16944-1-phillip.wood@talktalk.net>
From: Phillip Wood <phillip.wood@dunelm.org.uk>

Check that the console output is what we expect when restoring autostashed changes fails.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 t/t3420-rebase-autostash.sh       | 10 +++++++++-
 t/t3420/expected-fail-am          |  8 ++++++++
 t/t3420/expected-fail-interactive |  6 ++++++
 t/t3420/expected-fail-merge       | 32 ++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index 886be63c6d13e1ac4197a1b185659fb3d7d7eb26..4ff0d7aebd66b0ce091ceb11986b3928503c8c5f 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -148,7 +148,7 @@ testrebase() {
 		test_when_finished git branch -D rebased-feature-branch &&
 		echo dirty >file4 &&
 		git add file4 &&
-		git rebase$type unrelated-onto-branch &&
+		git rebase$type unrelated-onto-branch >tmp 2>&1 &&
 		test_path_is_missing $dotest &&
 		git reset --hard &&
 		grep unrelated file4 &&
@@ -157,6 +157,14 @@ testrebase() {
 		git stash pop &&
 		grep dirty file4
 	'
+
+	test_expect_success "rebase$type: check output with conflicting stash" '
+		suffix=${type#\ -} && suffix=${suffix:--am} &&
+		sed -f $TEST_DIRECTORY/t3420/remove-ids.sed tmp \
+			>actual-fail$suffix &&
+		test_cmp $TEST_DIRECTORY/t3420/expected-fail$suffix \
+			actual-fail$suffix
+	'
 }
 
 test_expect_success "rebase: fast-forward rebase" '
diff --git a/t/t3420/expected-fail-am b/t/t3420/expected-fail-am
new file mode 100644
index 0000000000000000000000000000000000000000..1d643fa2ef7e67f1ad1a49a02e81d2d6c66e6920
--- /dev/null
+++ b/t/t3420/expected-fail-am
@@ -0,0 +1,8 @@
+Created autostash: XXX
+HEAD is now at XXX third commit
+First, rewinding head to replay your work on top of it...
+Applying: second commit
+Applying: third commit
+Applying autostash resulted in conflicts.
+Your changes are safe in the stash.
+You can run "git stash pop" or "git stash drop" at any time.
diff --git a/t/t3420/expected-fail-interactive b/t/t3420/expected-fail-interactive
new file mode 100644
index 0000000000000000000000000000000000000000..9d1dd5264237e8f58e1960c6c0fb5b736df6f86d
--- /dev/null
+++ b/t/t3420/expected-fail-interactive
@@ -0,0 +1,6 @@
+Created autostash: XXX
+HEAD is now at XXX third commit
+Rebasing (1/2)\rRebasing (2/2)\rSuccessfully rebased and updated refs/heads/rebased-feature-branch.
+Applying autostash resulted in conflicts.
+Your changes are safe in the stash.
+You can run "git stash pop" or "git stash drop" at any time.
diff --git a/t/t3420/expected-fail-merge b/t/t3420/expected-fail-merge
new file mode 100644
index 0000000000000000000000000000000000000000..5dcb2ff3acdb93f55131d67ae227d231e097a2a2
--- /dev/null
+++ b/t/t3420/expected-fail-merge
@@ -0,0 +1,32 @@
+Created autostash: XXX
+HEAD is now at XXX third commit
+First, rewinding head to replay your work on top of it...
+Merging unrelated-onto-branch with HEAD~1
+Merging:
+XXX unrelated commit
+XXX second commit
+found 1 common ancestor:
+XXX initial commit
+[detached HEAD XXX] second commit
+ Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:14:13 2005 -0700
+ 2 files changed, 2 insertions(+)
+ create mode 100644 file1
+ create mode 100644 file2
+Committed: 0001 second commit
+Merging unrelated-onto-branch with HEAD~0
+Merging:
+XXX second commit
+XXX third commit
+found 1 common ancestor:
+XXX second commit
+[detached HEAD XXX] third commit
+ Author: A U Thor <author@example.com>
+ Date: Thu Apr 7 15:15:13 2005 -0700
+ 1 file changed, 1 insertion(+)
+ create mode 100644 file3
+Committed: 0002 third commit
+All done.
+Applying autostash resulted in conflicts.
+Your changes are safe in the stash.
+You can run "git stash pop" or "git stash drop" at any time.
-- 
2.13.0
Previous: Phillip WoodNext: Phillip Wood
Message 2 of 59 in “Add regression tests for recent rebase -i fixes”
  1. 0/3 Add regression tests for recent rebase -i fixesPhillip Wood, May 31, 2017
  2. 3/3 rebase: Add tests for console output with conflicting stashPhillip Wood, May 31, 2017
  3. 1/3 rebase -i: Add test for reflog messagePhillip Wood, May 31, 2017
  4. Junio C HamanoJun 1, 2017
  5. 2/3 rebase: Add tests for console outputPhillip Wood, May 31, 2017
  6. Phillip WoodMay 31, 2017
  7. Junio C HamanoJun 1, 2017
  8. Johannes SchindelinJun 1, 2017
  9. Junio C HamanoJun 1, 2017
  10. Stefan BellerJun 1, 2017
  11. pushing for a new hash, was Re: [PATCH 2/3] rebase: Add tests for console outputJohannes Schindelin, Jun 2, 2017
  12. Jonathan NiederJun 2, 2017
  13. Jonathan NiederJun 2, 2017
  14. Ævar Arnfjörð BjarmasonJun 2, 2017
  15. Johannes SchindelinJun 15, 2017
  16. Junio C HamanoJun 3, 2017
  17. Johannes SchindelinJun 6, 2017
  18. Jonathan NiederJun 6, 2017
  19. Junio C HamanoJun 7, 2017
  20. t4005: modernize style and drop hard coded sha1Stefan Beller, Jun 7, 2017
  21. Brandon WilliamsJun 7, 2017
  22. Stefan BellerJun 6, 2017
  23. Jonathan NiederJun 6, 2017
  24. Samuel LijinJun 7, 2017
  25. Johannes SchindelinJun 7, 2017
  26. Stefan BellerJun 7, 2017
  27. Phillip WoodJun 7, 2017
  28. Junio C HamanoJun 9, 2017
  29. Phillip WoodJun 14, 2017
  30. Johannes SchindelinJun 14, 2017
  31. 0/3 Add regression tests for rectent rebase -i fixesPhillip Wood, Jun 14, 2017
  32. 1/3 rebase -i: Add test for reflog messagePhillip Wood, Jun 14, 2017
  33. 2/3 rebase: Add regression tests for console outputPhillip Wood, Jun 14, 2017
  34. 3/3 rebase: Add more regression tests for console outputPhillip Wood, Jun 14, 2017
  35. Johannes SchindelinJun 14, 2017
  36. Junio C HamanoJun 15, 2017
  37. Junio C HamanoJun 15, 2017
  38. Junio C HamanoJun 15, 2017
  39. Johannes SchindelinJun 16, 2017
  40. Johannes SixtJun 16, 2017
  41. Junio C HamanoJun 16, 2017
  42. Johannes SixtJun 19, 2017
  43. Junio C HamanoJun 19, 2017
  44. Phillip WoodJun 19, 2017
  45. Junio C HamanoJun 19, 2017
  46. Phillip WoodJun 19, 2017
  47. 0/4 Add regression tests for recent rebase -i fixesPhillip Wood, Jun 19, 2017
  48. 1/4 sequencer: print autostash messages to stderrPhillip Wood, Jun 19, 2017
  49. 2/4 rebase -i: Add test for reflog messagePhillip Wood, Jun 19, 2017
  50. 3/4 rebase: Add regression tests for console outputPhillip Wood, Jun 19, 2017
  51. 4/4 rebase: Add more regression tests for console outputPhillip Wood, Jun 19, 2017
  52. Junio C HamanoJun 23, 2017
  53. Junio C HamanoJun 23, 2017
  54. Phillip WoodJun 23, 2017
  55. Junio C HamanoJun 23, 2017
  56. Junio C HamanoJun 23, 2017
  57. Phillip WoodJun 26, 2017
  58. Junio C HamanoJun 23, 2017
  59. Phillip WoodJun 26, 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.