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

Re: [PATCH] t9811: replace 'test -f' and '! test -f' with 'test_path_*'

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 3, 2026, 20:48 UTC
Message-ID
<xmqqfr1zhkak.fsf@gitster.g>
In-Reply-To
<akdwp_a2EuhVoGVW@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 6 quoted lines
>> -		test -f f1 && test -f f2 && test -f file_with_\$metachar &&
>> +		test_path_is_file f1 && test_path_is_file f2 && test_path_is_file file_with_\$metachar &&
>
> While at it we could split this line into three lines -- it's getting
> overly long, and we typically don't chain multiple commands on one line
> nowadays.
Excellent.
Show 8 quoted lines
>> -		! test -f main/f10 &&
>> +		test_path_is_missing main/f10 &&
>
> This is a stronger guarantee compared to before, as we only checked
> whether the path is not a file. Now we verify that it doesn't exist at
> all, which would be equivalent to `test -e`. That's a strict improvement
> though, but may be worth pointing out in the commit message so that the
> reviewer is not surprised.
Good.
Previous: Patrick SteinhardtNext: Marcelo Machado Lage
Message 3 of 9 in “t9811: replace 'test -f' and '! test -f' with 'test_path_*'”
  1. t9811: replace 'test -f' and '! test -f' with 'test_path_*'Marcelo Machado Lage, Jul 2, 2026
  2. Patrick SteinhardtJul 3, 2026
  3. Junio C HamanoJul 3, 2026
  4. Marcelo Machado LageJul 6, 2026
  5. Patrick SteinhardtJul 7, 2026
  6. 0/2 t9811: reformat and modernize testsMarcelo Machado Lage, Jul 11, 2026
  7. 1/2 t9811: break long && chains into multiple linesMarcelo Machado Lage, Jul 11, 2026
  8. 2/2 t9811: replace 'test -f' and '! test -f' with 'test_path_*'Marcelo Machado Lage, Jul 11, 2026
  9. Patrick SteinhardtJul 13, 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.