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

Re: [PATCH] t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*

From
Cogoni Guillaume <cogoni.guillaume@gmail.com>
Date
Feb 14, 2022, 20:22 UTC
Message-ID
<6fbd4188-3bb5-6d48-fd25-1bdbe9a3cbfb@gmail.com>
In-Reply-To
<xmqq5yplcme1.fsf@gitster.g>
First of all, sorry for the delay of this answer.
Show 6 quoted lines
> On 02/11/2022 at 7:02 PM, Junio ​​C Hamano wrote:
>
> This is not wrong per-se, and I know I shouldn't demand too much
> from a practice patch like this, but for a real patch, I hope
> contributors carefully check if the original is doing the right
> thing.

It's good that you are demanding even for a practice patch because we are here to learn as much as we can. And, we will take a good attention to your ideas.

Show 9 quoted lines
>   * verify that all existing users of test_path_is_file want to
>     reject a symlink to file, and add 'test ! -h "$1" &&' to the
>     implementation of the test helper in t/test-lib-functions.sh
>     (we may want to do the same for test_path_is_dir).
>
>   * introduce test_path_is_symlink and use it appropriately.  This
>     will be a more verbose version of "test -h".
>
>   * introduce test_path_is_file_not_symlink and use it here.

We wouldn't modify test_path_is_file because this function is already use and we won't verify if every uses of this are rejecting symlink.

However, we would like to try to implement test_path_is_symlink and test_path_is_file_not_symlink and the symmetric for directory.

Thanks for your review and the ideas. COGONI Guillaume and BRESSAT Jonathan

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 3 of 15 in “t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*”
  1. t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*COGONI Guillaume, Feb 11, 2022
  2. Junio C HamanoFeb 11, 2022
  3. Cogoni GuillaumeFeb 14, 2022
  4. Ævar Arnfjörð BjarmasonFeb 15, 2022
  5. 0/2 replace test [-f|-d] with more verbose functionsCOGONI Guillaume, Feb 18, 2022
  6. 0/2 replace test [-f|-d] with more verbose functionsCOGONI Guillaume, Feb 18, 2022
  7. 1/2 t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*COGONI Guillaume, Feb 18, 2022
  8. 2/2 Add new tests functions like test_path_is_*COGONI Guillaume, Feb 18, 2022
  9. Junio C HamanoFeb 18, 2022
  10. 0/3 replace test [-f|-d] with more verbose functionsCOGONI Guillaume, Feb 22, 2022
  11. 1/3 t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*COGONI Guillaume, Feb 22, 2022
  12. 2/3 tests: allow testing if a path is truly a file or a directoryCOGONI Guillaume, Feb 22, 2022
  13. 3/3 tests: make the code more readableCOGONI Guillaume, Feb 22, 2022
  14. Junio C HamanoFeb 23, 2022
  15. Cogoni GuillaumeFeb 24, 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.