git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Philip Oakley <philipoakley@iee.org>, Jeff King <peff@peff.net>,
	Phillip Wood <phillip.wood@dunelm.org.uk>,
	Liam Beguin <liambeguin@gmail.com>
Subject: [PATCH v6 06/10] t3404: relax rebase.missingCommitsCheck tests
Date: Fri, 14 Jul 2017 16:45:14 +0200 (CEST)	[thread overview]
Message-ID: <47d54a53ad8b5efdb74e0e8624f2740d6ae84c2c.1500043437.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <cover.1500043436.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 37821d24543..3704dbb2ecf 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1249,20 +1249,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) &&
@@ -1284,20 +1277,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.3.windows.1.13.gaf0c2223da0



  parent reply	other threads:[~2017-07-14 14:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 14:44 [PATCH v6 00/10] The final building block for a faster rebase -i Johannes Schindelin
2017-07-14 14:44 ` [PATCH v6 01/10] t3415: verify that an empty instructionFormat is handled as before Johannes Schindelin
2017-07-14 14:44 ` [PATCH v6 02/10] rebase -i: generate the script via rebase--helper Johannes Schindelin
2017-07-14 22:50   ` Stefan Beller
2017-07-15 12:56     ` Johannes Schindelin
2017-07-14 14:45 ` [PATCH v6 03/10] rebase -i: remove useless indentation Johannes Schindelin
2017-07-14 14:45 ` [PATCH v6 04/10] rebase -i: do not invent onelines when expanding/collapsing SHA-1s Johannes Schindelin
2017-07-14 14:45 ` [PATCH v6 05/10] rebase -i: also expand/collapse the SHA-1s via the rebase--helper Johannes Schindelin
2017-07-14 14:45 ` Johannes Schindelin [this message]
2017-07-14 14:45 ` [PATCH v6 07/10] rebase -i: check for missing commits in " Johannes Schindelin
2017-07-14 14:45 ` [PATCH v6 08/10] rebase -i: skip unnecessary picks using " Johannes Schindelin
2017-07-14 14:45 ` [PATCH v6 09/10] t3415: test fixup with wrapped oneline Johannes Schindelin
2017-07-14 14:45 ` [PATCH v6 10/10] rebase -i: rearrange fixup/squash lines using the rebase--helper Johannes Schindelin
2017-07-14 17:27 ` [PATCH v6 00/10] The final building block for a faster rebase -i Stefan Beller
2017-07-14 20:39   ` Johannes Schindelin
2017-07-20 21:38 ` Junio C Hamano
2017-07-22 11:44   ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47d54a53ad8b5efdb74e0e8624f2740d6ae84c2c.1500043437.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=liambeguin@gmail.com \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.org \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).