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

Re: [PATCH v4] branch: introduce --show-current display option

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 17, 2018, 10:39 UTC
Message-ID
<20181017103902.GA12137@flurp.local>
In-Reply-To
<nycvar.QRO.7.76.6.1810171211440.4546@tvgsbejvaqbjf.bet>
On Wed, Oct 17, 2018 at 6:18 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 10 quoted lines
> I realized yesterday that the &&-chain linting we use for every single
> test case takes a noticeable chunk of time:
>
>         $ time ./t0006-date.sh --quiet
>         real    0m20.973s
>         $ time ./t0006-date.sh --quiet --no-chain-lint
>         real    0m13.607s
>
> My suspicion: it is essentially the `(exit 117)` that adds about 100ms to
> every of those 67 test cases.
The subshell chain-linter adds a 'sed' and 'grep' invocation to each test which doesn't help. (v1 of the subshell chain-linter only added a 'sed', but that changed with v2.)
> With that in mind, I would like to suggest that we should start to be very
> careful about using subshells in our test suite.
You could disable the subshell chain-linter like this if you want test the (exit 117) goop in isolation:
--- 8< ---
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3f95bfda60..48323e503c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -675,8 +675,7 @@ test_run_ () {
 		trace=
 		# 117 is magic because it is unlikely to match the exit
 		# code of other programs
-		if $(printf '%s\n' "$1" | sed -f "$GIT_BUILD_DIR/t/chainlint.sed" | grep -q '?![A-Z][A-Z]*?!') ||
-			test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)"
+		if test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)"
 		then
 			error "bug in the test script: broken &&-chain or run-away HERE-DOC: $1"
 		fi
--- 8< ---
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 22 of 30 in “branch: introduce --show-current display option”
  1. 0/1 branch: introduce --show-current display optionDaniels Umanovskis, Oct 10, 2018
  2. 1/1 branch: introduce --show-current display optionDaniels Umanovskis, Oct 10, 2018
  3. Jeff KingOct 11, 2018
  4. Rafael AscensãoOct 11, 2018
  5. Daniels UmanovskisOct 11, 2018
  6. Jeff KingOct 11, 2018
  7. Rafael AscensãoOct 11, 2018
  8. Daniels UmanovskisOct 11, 2018
  9. Jeff KingOct 11, 2018
  10. Rafael AscensãoOct 11, 2018
  11. Junio C HamanoOct 11, 2018
  12. Daniels UmanovskisOct 11, 2018
  13. Jeff KingOct 11, 2018
  14. branch: introduce --show-current display optionDaniels Umanovskis, Oct 11, 2018
  15. Junio C HamanoOct 11, 2018
  16. Daniels UmanovskisOct 11, 2018
  17. branch: introduce --show-current display optionDaniels Umanovskis, Oct 12, 2018
  18. Eric SunshineOct 12, 2018
  19. Junio C HamanoOct 16, 2018
  20. Eric SunshineOct 16, 2018
  21. Johannes SchindelinOct 17, 2018
  22. Eric SunshineOct 17, 2018
  23. Johannes SchindelinOct 18, 2018
  24. Eric SunshineOct 18, 2018
  25. Junio C HamanoOct 16, 2018
  26. Rafael AscensãoOct 17, 2018
  27. Daniels UmanovskisOct 17, 2018
  28. SZEDER GáborOct 11, 2018
  29. SZEDER GáborOct 11, 2018
  30. Daniels UmanovskisOct 11, 2018

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.