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

Re: [PATCH v2 2/2] t7510: add test cases for non-absolute gpg program

From
Jeff King <peff@peff.net>
Date
Jul 25, 2025, 04:30 UTC
Message-ID
<20250725043043.GA3002998@coredump.intra.peff.net>
In-Reply-To
<20250722190922.51183-3-jonas.brandstoetter@gmx.at>
On Tue, Jul 22, 2025 at 09:09:22PM +0200, Jonas Brandstötter wrote:
Show 14 quoted lines
>  	test_must_fail env LET_GPG_PROGRAM_FAIL=1 \
>  	git commit -S --allow-empty -m must-fail 2>err &&
> -	grep zOMG err
> +	grep zOMG err &&
> +
> +	# `gpg.program` starts with `~`, the path should be interpreted to be relative to `$HOME`
> +	test_config gpg.program "~/fake-gpg" &&
> +	env HOME="$(pwd)" \
> +	git commit -S --allow-empty -m signed-commit &&
> +
> +	# `gpg.program` does not specify an absolute path, it should find a program in `$PATH`
> +	test_config gpg.program "fake-gpg" &&
> +	env PATH="$(pwd):$PATH" \
> +	git commit -S --allow-empty -m signed-commit
This second test seems to fail on Windows. E.g., in this CI job:
  https://github.com/git/git/actions/runs/16509422831/job/46688307091

Right before the failure, the trace shows that we are setting PATH like this:

  ++env 'PATH=D:/a/git/git/t/trash directory.t7510-signed-commit:/d/a/git/git:/d/a/git/git/t/helper:/c/Users/runneradmin/path:/mingw64/bin:/usr/bin/:/usr/bin/core_perl:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem'

Should it be "/d/a/git/git/..." instead of "D:/a/git/git/..."? Which we could get by using $PWD, I think.

The earlier one using $HOME uses D:/, but this one is different because colons are meaningful separators in $PATH.

-Peff
Previous: Jonas BrandstötterNext: Jeff King
Message 8 of 15 in “[BUG] gpg.program: '~' not expanded to home directory”
  1. Ross MacArthurJul 11, 2025
  2. gpg-interface: expand gpg.program as a pathJonas Brandstötter, Jul 11, 2025
  3. Junio C HamanoJul 14, 2025
  4. 0/2 gpg-interface: expand gpg.program as a pathJonas Brandstötter, Jul 22, 2025
  5. Junio C HamanoJul 22, 2025
  6. 1/2 gpg-interface: expand gpg.program as a pathJonas Brandstötter, Jul 22, 2025
  7. 2/2 t7510: add test cases for non-absolute gpg programJonas Brandstötter, Jul 22, 2025
  8. Jeff KingJul 25, 2025
  9. Jeff KingJul 25, 2025
  10. Junio C HamanoJul 29, 2025
  11. Jeff KingJul 29, 2025
  12. Junio C HamanoJul 29, 2025
  13. Junio C HamanoJul 12, 2025
  14. Andreas SchwabJul 12, 2025
  15. Junio C HamanoJul 12, 2025

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.