git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:33 UTC

Re: [GSoC PATCH 07/16] t4153: avoid suppressing git's exit code

From
Tian Yuchen <a3205153416@gmail.com>
Date
Mar 29, 2026, 15:59 UTC
Message-ID
<3575e53a-a675-4e55-bc17-cce9cff1423f@gmail.com>
In-Reply-To
<20260328200255.247759-8-vikingtc4@gmail.com>
On 3/29/26 04:02, Trieu Huynh wrote:
Show 21 quoted lines
> Update t4153-am-resume-override-opts.sh to redirect git-cmds
> output to a temporary file instead of piping it directly to
> not hide the exit code of git commands behind pipes, as a crash
> in git might go unnoticed.
> 
> Signed-off-by: Trieu Huynh <vikingtc4@gmail.com>
> ---
>   t/t4153-am-resume-override-opts.sh | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh
> index 9bec989a0e..30137aec20 100755
> --- a/t/t4153-am-resume-override-opts.sh
> +++ b/t/t4153-am-resume-override-opts.sh
> @@ -81,7 +81,8 @@ test_expect_success '--signoff overrides --no-signoff' '
>   
>   	# Applied side1 will be signed off
>   	echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected &&
> -	git cat-file commit HEAD^ | grep "Signed-off-by:" >actual &&
> +	git cat-file commit HEAD^ >commit_raw &&
> +	test_grep "Signed-off-by:" commit_raw >actual &&

The behavior of 'test_grep' is the opposite of what you might expect. It does nothing when the input matches, and only reports an error when it doesn't match. Therefore, 'actual' is empty here...

>   	test_cmp expected actual &&
>   
>   	# Applied side2 will not be signed off
...and this test is bound to fail.
Regards, Yuchen
Previous: Trieu HuynhNext: Tian Yuchen
Message 20 of 24 in “Microproject: avoid suppressing git's exit code”
  1. 00/16 Microproject: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  2. 01/16 t7004: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  3. 02/16 t6423: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  4. 03/16 t6411: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  5. 04/16 t6101: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  6. 05/16 t6006: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  7. 06/16 t5304: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  8. 07/16 t4153: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  9. 08/16 t4150: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  10. 09/16 t4140: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  11. 10/16 t4039: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  12. 11/16 t3903: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  13. 12/16 t3701: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  14. 13/16 t3412: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  15. 14/16 t1400: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  16. 15/16 t0100: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  17. 16/16 t2206: avoid suppressing git's exit codeTrieu Huynh, Mar 28, 2026
  18. Junio C HamanoMar 29, 2026
  19. Trieu HuynhMar 29, 2026
  20. Tian YuchenMar 29, 2026
  21. Tian YuchenMar 29, 2026
  22. Karthik NayakMar 30, 2026
  23. Junio C HamanoMar 30, 2026
  24. Trieu HuynhMar 30, 2026

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.