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

Re: [PATCH v2 3/3] test-lib.sh: support -x option for shell-tracing

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2014, 22:31 UTC
Message-ID
<xmqqd29v1u0a.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqqh9z71uf9.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> Does 1308 pass with this patch for you (running it without "-x")?
>
> The original that expects a hardcoded line number (not relative to
> the original or something) is a bad taste, and also the test setup
> procedure is broken (see below for a fix of that breakage, which
> does not fix the breakage this patch seems to bring in anyway).
>
> But still it is disturbing to see that there is a blank line
> difference with and without this change in the file created by the
> test (i.e. the client of the code this patch touches).

This is even more disturbing. With this fix (which is correct as far as I can tell) queued on top of ta/config-set, the shell-tracing patch does not fail any more.

I suspect that the broken test in the original ended the .git/config file with an incomplete line or something, and with the attached fix we no longer do so and that is why shell-tracing patch no longer breaks it, it seems. So if there is a test that does want to create a file that ends with an incomplete line, we may see the real breakage again with the shell-tracing patch in.

-- >8 --
Subject: [PATCH] t1308: fix broken here document in test script
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1308-config-set.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
index 7fdf840..243d612 100755
--- a/t/t1308-config-set.sh
+++ b/t/t1308-config-set.sh
@@ -23,7 +23,7 @@ check_config () {
 }
 
 test_expect_success 'setup default config' '
-	cat >.git/config <<\EOF
+	cat >.git/config <<-\EOF
 	[case]
 		penguin = very blue
 		Movie = BadPhysics
@@ -185,7 +185,7 @@ test_expect_success 'proper error on error in default config files' '
 	cp .git/config .git/config.old &&
 	test_when_finished "mv .git/config.old .git/config" &&
 	echo "[" >>.git/config &&
-	echo "fatal: bad config file line 35 in .git/config" >expect &&
+	echo "fatal: bad config file line 34 in .git/config" >expect &&
 	test_expect_code 128 test-config get_value foo.bar 2>actual &&
 	test_cmp expect actual
 '
-- 
2.1.2-468-g1a77c5b
Previous: Junio C HamanoNext: Jeff King
Message 17 of 26 in “"-x" tracing option for tests”
  1. 0/3 "-x" tracing option for testsJeff King, Oct 10, 2014
  2. 1/3 t5304: use test_path_is_* instead of "test -f"Jeff King, Oct 10, 2014
  3. 2/3 t5304: use helper to report failure of "test foo = bar"Jeff King, Oct 10, 2014
  4. Jonathan NiederOct 13, 2014
  5. Jeff KingOct 13, 2014
  6. Jonathan NiederOct 13, 2014
  7. Junio C HamanoOct 13, 2014
  8. Jonathan NiederOct 13, 2014
  9. Junio C HamanoOct 13, 2014
  10. Jeff KingOct 13, 2014
  11. 3/3 test-lib.sh: support -x option for shell-tracingJeff King, Oct 10, 2014
  12. Jeff KingOct 10, 2014
  13. Jeff KingOct 10, 2014
  14. 3/3 test-lib.sh: support -x option for shell-tracingJeff King, Oct 10, 2014
  15. Junio C HamanoOct 13, 2014
  16. Junio C HamanoOct 13, 2014
  17. Junio C HamanoOct 13, 2014
  18. Jeff KingOct 13, 2014
  19. Junio C HamanoOct 13, 2014
  20. Jeff KingOct 13, 2014
  21. Junio C HamanoOct 13, 2014
  22. Jeff KingOct 14, 2014
  23. Junio C HamanoOct 13, 2014
  24. Jeff KingOct 13, 2014
  25. Michael HaggertyOct 14, 2014
  26. Jeff KingOct 14, 2014

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.