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

[PATCH v5 06/10] t3404: relax rebase.missingCommitsCheck tests

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 14, 2017, 13:07 UTC
Message-ID
<bc86ff44d5fa0ee2bf69ab6a7e06d52d4b9df3d8.1497444257.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1497444257.git.johannes.schindelin@gmx.de>

These tests were a bit anal about the *exact* warning/error message printed by git rebase. But those messages are intended for the *end user*, therefore it does not make sense to test so rigidly for the *exact* wording.

In the following, we will reimplement the missing commits check in the sequencer, with slightly different words.

So let's just test for the parts in the warning/error message that we *really* care about, nothing more, nothing less.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3404-rebase-interactive.sh | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 5bd0275930b..3b411ea8f1b 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1242,20 +1242,13 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
 	test B = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
-cat >expect <<EOF
-Warning: the command isn't recognized in the following line:
- - badcmd $(git rev-list --oneline -1 master~1)
-
-You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
-Or you can abort the rebase with 'git rebase --abort'.
-EOF
-
 test_expect_success 'static check of bad command' '
 	rebase_setup_and_clean bad-cmd &&
 	set_fake_editor &&
 	test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
 		git rebase -i --root 2>actual &&
-	test_i18ncmp expect actual &&
+	test_i18ngrep "badcmd $(git rev-list --oneline -1 master~1)" actual &&
+	test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
 	FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&
 	git rebase --continue &&
 	test E = $(git cat-file commit HEAD | sed -ne \$p) &&
@@ -1277,20 +1270,13 @@ test_expect_success 'tabs and spaces are accepted in the todolist' '
 	test E = $(git cat-file commit HEAD | sed -ne \$p)
 '
 
-cat >expect <<EOF
-Warning: the SHA-1 is missing or isn't a commit in the following line:
- - edit XXXXXXX False commit
-
-You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
-Or you can abort the rebase with 'git rebase --abort'.
-EOF
-
 test_expect_success 'static check of bad SHA-1' '
 	rebase_setup_and_clean bad-sha &&
 	set_fake_editor &&
 	test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
 		git rebase -i --root 2>actual &&
-	test_i18ncmp expect actual &&
+	test_i18ngrep "edit XXXXXXX False commit" actual &&
+	test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
 	FAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&
 	git rebase --continue &&
 	test E = $(git cat-file commit HEAD | sed -ne \$p)
-- 
2.13.1.windows.1.1.ga36e14b3aaa
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 20 in “The final building block for a faster rebase -i”
  1. 00/10 The final building block for a faster rebase -iJohannes Schindelin, Jun 14, 2017
  2. 02/10 rebase -i: generate the script via rebase--helperJohannes Schindelin, Jun 14, 2017
  3. 01/10 t3415: verify that an empty instructionFormat is handled as beforeJohannes Schindelin, Jun 14, 2017
  4. 03/10 rebase -i: remove useless indentationJohannes Schindelin, Jun 14, 2017
  5. 04/10 rebase -i: do not invent onelines when expanding/collapsing SHA-1sJohannes Schindelin, Jun 14, 2017
  6. 05/10 rebase -i: also expand/collapse the SHA-1s via the rebase--helperJohannes Schindelin, Jun 14, 2017
  7. 06/10 t3404: relax rebase.missingCommitsCheck testsJohannes Schindelin, Jun 14, 2017
  8. 07/10 rebase -i: check for missing commits in the rebase--helperJohannes Schindelin, Jun 14, 2017
  9. 08/10 rebase -i: skip unnecessary picks using the rebase--helperJohannes Schindelin, Jun 14, 2017
  10. Liam BeguinJun 16, 2017
  11. Johannes SchindelinJun 16, 2017
  12. Liam BeguinJun 17, 2017
  13. Johannes SchindelinJun 19, 2017
  14. Jeff KingJun 19, 2017
  15. Junio C HamanoJun 19, 2017
  16. Liam BeguinJun 20, 2017
  17. 09/10 t3415: test fixup with wrapped onelineJohannes Schindelin, Jun 14, 2017
  18. 10/10 rebase -i: rearrange fixup/squash lines using the rebase--helperJohannes Schindelin, Jun 14, 2017
  19. Junio C HamanoJun 15, 2017
  20. Johannes SchindelinJun 16, 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.