Re: [PATCH 4/6] t7500: add tests for --fixup[amend|reword] options

2 messages, 2 authors, 2021-02-18 · open the first message on its own page

Re: [PATCH 4/6] t7500: add tests for --fixup[amend|reword] options

From: Junio C Hamano <hidden>
Date: 2021-02-17 20:00:53

Charvi Mendiratta [off-list ref] writes:
Subject: Re: [PATCH 4/6] t7500: add tests for --fixup[amend|reword] options
Isn't an equal '=' sign missing somewhere?
+test_fixup_reword_opt () {
+	test_expect_success C_LOCALE_OUTPUT "--fixup=reword: incompatible with $1" "
+		echo 'fatal: cannot combine reword option of --fixup with $1' >expect &&
+		test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual &&
+		test_cmp expect actual
+	"
+}
+
+for opt in --all --include --only
+do
+	test_fixup_reword_opt $opt
+done
As I suspected earlier, a pathspec is not tested here, but it should
be.
+test_expect_success '--fixup=reword: -F give error message' '
+	echo "fatal: Only one of -c/-C/-F/--fixup can be used." >expect &&
+	test_must_fail git commit --fixup=reword:HEAD~ -F msg  2>actual &&
+	test_cmp expect actual
+'
Why?  If you can use -m msg, you should be able to use -F msgfile,
too, no?
 test_expect_success 'commit --squash works with -F' '
 	commit_for_rebase_autosquash_setup &&

Re: [PATCH 4/6] t7500: add tests for --fixup[amend|reword] options

From: Charvi Mendiratta <hidden>
Date: 2021-02-18 12:24:51

On Thu, 18 Feb 2021 at 01:29, Junio C Hamano [off-list ref] wrote:
[...]
quoted
+for opt in --all --include --only
+do
+     test_fixup_reword_opt $opt
+done
As I suspected earlier, a pathspec is not tested here, but it should
be.
Okay, I will add it here.
quoted
+test_expect_success '--fixup=reword: -F give error message' '
+     echo "fatal: Only one of -c/-C/-F/--fixup can be used." >expect &&
+     test_must_fail git commit --fixup=reword:HEAD~ -F msg  2>actual &&
+     test_cmp expect actual
+'
Why?  If you can use -m msg, you should be able to use -F msgfile,
too, no?
Earlier I was thinking to let the `--fixup=amend:`  use the same options as of
current `--fixup=` . But yes I agree that there should be  -F option
also with `amend`
and `reword`.

Thanks for the corrections, will do all the changes and update in the
next revision.

Thanks and Regards,
Charvi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help