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

Re: [GSOC][RFC] microproject: use test_path_is_* functions in test scripts

From
vincenzo mezzela <vincenzo.mezzela@gmail.com>
Date
Feb 14, 2024, 10:20 UTC
Message-ID
<CAF2+nma0HZUPevhT7A4vM0rFYF07eF_u9Sg2wRAQ8E2+qBj5uQ@mail.gmail.com>
In-Reply-To
<xmqqy1bo5k5h.fsf@gitster.g>
Show 8 quoted lines
> One thing to note is that you'd need to make sure if "test -e" for
> example originally written really means "we want to see something
> there and it does not matter if it is a file or a directory" while
> turning it into test_path_exists.  The operations that such a test
> follows may be expected to create a file and never a directory, in
> which case the condition the original code is testing may need to
> be corrected first to expect a more specific type (e.g. "test -f").
> The same comment applies for the other two.
Thanks for this clarification!
> Some tests check with "! test -f <path>", which often would want to
> be turned into "test_path_is_missing", but you'd need to make sure
> that is what the original test really meant to do.
I'd have changed them into:
-  ! test -f <path> --> ! test_path_is_file <path>
-  ! test -e <path> --> test_path_is_missing <path>
Since '! test -f <path>' and 'test_path_is_missing <path>' can return
different values.

But as you said, I'll check what they are really meant to do and modify them accordingly :)

Show 11 quoted lines
>
> A microproject is not about "doing the real work to help the
> project".  It is a practice session to come up with a set of small
> changes and explain them well, to send the result to the list to get
> reviewed, to respond to reviews and possibly send updates, and to
> repeat the cycle until completion.  So most likely you'd pick a
> single file or two and do the above conversion, while leaving the
> others as practice material for other GSoC participants.
>
> Enjoy.
>
Thanks for this clarification too. :)
Vincenzo
Previous: Junio C Hamano
Message 5 of 5 in “[GSOC][RFC] microproject: use test_path_is_* functions in test scripts”
  1. Vincenzo MEZZELAFeb 13, 2024
  2. Christian CouderFeb 13, 2024
  3. Eric SunshineFeb 13, 2024
  4. Junio C HamanoFeb 13, 2024
  5. vincenzo mezzelaFeb 14, 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.