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

Re: [GSoC] [PATCH v2] t1011: replace test -f with test_path_is_file

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 14, 2022, 16:42 UTC
Message-ID
<xmqqy2071urp.fsf@gitster.g>
In-Reply-To
<CAP8UFD3RtQecxOQWVeapH1CYsMiY2+MoHeugb9bvOsFVnozy=w@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
> In the commit message it might be nice if there were some explanations
> about why `test_path_is_missing PATH` should be used instead of `!
> test_path_is_file PATH` or `test ! -f PATH` or `! test -f PATH`.

Meaning "the original used '! test -f foo' but what it meant was that it did not want to see 'foo' on the filesystem, regardless of its type, so it should have been '!test -e foo' to begin with"?

I guess it does not hurt, as the original would have passed by mistake if these paths were on the filesystem as directories, but the new code would behave differently, and even if it is a "bugfix", it still is a behaviour change that may be worth explaining.

> The diff part of the patch looks good to me. Thanks!
Previous: Christian CouderNext: Siddharth Asthana
Message 6 of 8 in “t1011: replace test -f with test_path_is_file”
  1. Siddharth AsthanaApr 9, 2022
  2. Junio C HamanoApr 11, 2022
  3. Siddharth AsthanaApr 12, 2022
  4. [GSoC] [PATCH v2] t1011: replace test -f with test_path_is_fileSiddharth Asthana, Apr 12, 2022
  5. Christian CouderApr 14, 2022
  6. Junio C HamanoApr 14, 2022
  7. Siddharth AsthanaApr 16, 2022
  8. t1011: replace test -f with test_path_is* helpersSiddharth Asthana, Apr 16, 2022

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.