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

Re: [GSOC][PATCH v4 1/1] t7301: use test_path_is_(missing|file)

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2024, 16:32 UTC
Message-ID
<xmqqr0ggu3tq.fsf@gitster.g>
In-Reply-To
<20240310114311.598681-2-vincenzo.mezzela@gmail.com>
Vincenzo Mezzela <vincenzo.mezzela@gmail.com> writes:
> Replace use of 'test -f' with 'test_path_is_file' helper functions from
Before "helper functions", we'd need another pair, e.g.
    and 'test ! -f' with 'test_path_is_missing'

otherwise the plurals in the remainder of the paragraph would not make much sense.

> test-lib-functions.sh. These functions perform identical operations
> while enhancing debugging capabilities in case of test failures.
Show 5 quoted lines
>
> In the context of this file, 'test ! -f' is meant to check if the file
> has been correctly cleaned, so it should be 'test ! -e'.
> Thus its usage is replaced with 'test_path_is_missing' instead of 
> '! test_path_is_file'.

Even if the test meant not to complain when there is something not a regular file (e.g. a directory), "! test_path_is_file" is not the right way to express it, so the way this paragraph is written is somewhat misleading. Something like

    The original used `test ! -f` but it did not mean that the tests
    are happy if a directory exists there.  It should have used
    `test ! -e`, and using test_path_is_missing matches the intent.
perhaps.
Previous: Vincenzo Mezzela
Message 14 of 14 in “microproject: use test_path_is_* functions in test scripts”
  1. Vincenzo MezzelaFeb 19, 2024
  2. [GSOC][RFC PATCH 1/1] t: t7301-clean-interactive: Use test_path_is_(missing|file)Vincenzo Mezzela, Feb 19, 2024
  3. Christian CouderFeb 26, 2024
  4. Eric SunshineFeb 19, 2024
  5. [GSOC][PATCH v2 0/1] microproject: use test_path_is_* functions in test scriptsVincenzo Mezzela, Feb 27, 2024
  6. [GSOC][PATCH v2 1/1] t7301: use test_path_is_(missing|file)Vincenzo Mezzela, Feb 27, 2024
  7. Patrick SteinhardtMar 4, 2024
  8. [GSOC][PATCH v3 0/1] microproject: use test_path_is_* functions in test scriptsVincenzo Mezzela, Mar 4, 2024
  9. [GSOC][PATCH v3 1/1] t7301: use test_path_is_(missing|file)Vincenzo Mezzela, Mar 4, 2024
  10. Junio C HamanoMar 4, 2024
  11. Eric SunshineMar 4, 2024
  12. [GSOC][PATCH v4 0/1] microproject: use test_path_is_* functions in test scriptsVincenzo Mezzela, Mar 10, 2024
  13. [GSOC][PATCH v4 1/1] t7301: use test_path_is_(missing|file)Vincenzo Mezzela, Mar 10, 2024
  14. Junio C HamanoMar 11, 2024

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.