Re: [PATCH v2 04/22] test-lib functions: add --printf option to test_commit

2 messages, 2 authors, 2021-04-12 · open the first message on its own page

Re: [PATCH v2 04/22] test-lib functions: add --printf option to test_commit

From: Junio C Hamano <hidden>
Date: 2021-03-30 23:13:08

Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted hunk
 test_expect_success 'can parse blob ending with CR' '
-	printf "[some]key = value\\r" >config &&
-	git add config &&
-	git commit -m CR &&
+	test_commit --printf CR config "[some]key = value\\r" &&
OK, the first arg becomes the commit title, and the second one is
used for the filename, and the next arg is the string given to
printf, I guess.
quoted hunk
 test_expect_success 'rerere forget (binary)' '
 	git checkout -f side &&
-	printf "a\0c" >binary &&
-	git commit -a -m binary &&
+	test_commit binary binary "a\0c" &&
This lacks --printf.  Are we breaking the test but "test-must-fail"
is hiding the breakage here?
 	test_must_fail git merge second &&
 	git rerere forget binary
 '

Re: [PATCH v2 04/22] test-lib functions: add --printf option to test_commit

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-04-12 13:19:28

On Wed, Mar 31 2021, Junio C Hamano wrote:
Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted
 test_expect_success 'can parse blob ending with CR' '
-	printf "[some]key = value\\r" >config &&
-	git add config &&
-	git commit -m CR &&
+	test_commit --printf CR config "[some]key = value\\r" &&
OK, the first arg becomes the commit title, and the second one is
used for the filename, and the next arg is the string given to
printf, I guess.
quoted
 test_expect_success 'rerere forget (binary)' '
 	git checkout -f side &&
-	printf "a\0c" >binary &&
-	git commit -a -m binary &&
+	test_commit binary binary "a\0c" &&
This lacks --printf.  Are we breaking the test but "test-must-fail"
is hiding the breakage here?
Yes, well spotted. FWIW in splitting this out into another series I
fixed this bug in the re-roll:
https://lore.kernel.org/git/cover-00.16-00000000000-20210412T110456Z-avarab@gmail.com/T/#ma9ef67d8198c203adc05aab44f87aa753a3df993
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help