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

[PATCH] t4014: treat rev-list output as the expected value

From
Denton Liu <liu.denton@gmail.com>
Date
Oct 8, 2019, 09:14 UTC
Message-ID
<30d03ed76e46a10bea883ba3fe85b186fbf31d25.1570526007.git.liu.denton@gmail.com>
In-Reply-To
<20191007210306.GF11529@szeder.dev>

In 6bd26f58ea (t4014: use test_line_count() where possible, 2019-08-27), we converted many test cases to take advantage of the test_line_count() function. In one conversion, we inverted the expected and actual value as tested by test_line_count(). Although functionally correct, if format-patch ever produced incorrect output, the debugging output would be a bunch of hashes which would be difficult to debug.

Invert the expected and actual values provided to test_line_count() so that if format-patch produces incorrect output, the debugging output will be a list of human-readable files instead.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
Thanks for point out my mistake, Szeder. This patch can be applied to
the tip of 'dl/format-patch-doc-test-cleanup' and then we should base
Bert's changes on top of this branch.
 t/t4014-format-patch.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 83f52614d3..72b09896cf 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1610,8 +1610,9 @@ test_expect_success 'format-patch format.outputDirectory option' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches &&
 	git format-patch master..side &&
-	git rev-list master..side >list &&
-	test_line_count = $(ls patches | wc -l) list
+	count=$(git rev-list --count master..side) &&
+	ls patches >list &&
+	test_line_count = $count list
 '
 
 test_expect_success 'format-patch -o overrides format.outputDirectory' '
-- 
2.23.0.248.g3a9dd8fb08
Previous: Bert Wesarg
Message 7 of 7 in “format-patch: create leading components of output directory”
  1. 1/2 format-patch: create leading components of output directoryBert Wesarg, Oct 5, 2019
  2. 2/2 [RFC] format-patch: configure a command to generate the output directory nameBert Wesarg, Oct 5, 2019
  3. Junio C HamanoOct 6, 2019
  4. SZEDER GáborOct 7, 2019
  5. Junio C HamanoOct 8, 2019
  6. Bert WesargOct 8, 2019
  7. t4014: treat rev-list output as the expected valueDenton Liu, Oct 8, 2019

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.