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

Re: [OUTREACHY][PATCH v2] t7006: Use test_path_is_* functions in test script

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 27, 2020, 00:14 UTC
Message-ID
<20201027001427.GG2645313@google.com>
In-Reply-To
<XDwhHkxbkjL46BTp1WCJ5gJ3UbrMxRGwR2VgeRxehZh0-G07JlxCHrBGCpruqk-OegVspO6LJ0Y3yW9izl97pufYDwOhGaS885_xaVK63vs=@protonmail.com>
Joey Salazar wrote:
> On Monday, October 26, 2020 5:00 PM, Joey Salazar <jgsal@protonmail.com> wrote:
Show 14 quoted lines
>> Modernize the test by replacing `test -e` instances with
>> `test_path_is_file` helper functions, and `! test -e` with
>> `test_path_is_missing`, for better readability and diagnostic messages.
>> For instances when `${if_local_config}` is either '' or '! ' then
>> `test_path_is_file` will diagnose the directory and print a message if
>> and only if the result `is false` goes away.
>
> If `if test -n '$pager_wanted'` is checking if pager_wanted=true
> before diagnosing core.pager_used, then would;
>
> For other instances when '$pager_wanted' is not empty then `test_path_is_file`
> will diagnose the directory and print a message.
>
> be more accurate?

Yes, but because it restates what the patch says instead of describing the "why", it's at the wrong level of abstraction.

Starting from
    t7006: Use test_path_is_* functions in test script
    Modernize the test by replacing `test -e` instances with
    `test_path_is_file` helper functions, and `! test -e` with
    `test_path_is_missing`, for better readability and diagnostic messages.

I think what would make sense is to add a second paragraph describing why the existing code uses ${if_local_config} and why what the new code is doing is better.

Thanks, Jonathan

Previous: Joey SalazarNext: Joey Salazar
Message 13 of 16 in “t7006: Use test_path_is_* functions in test script”
  1. Joey SOct 20, 2020
  2. Phillip WoodOct 21, 2020
  3. Junio C HamanoOct 21, 2020
  4. Joey SalazarOct 21, 2020
  5. Junio C HamanoOct 21, 2020
  6. Joey SalazarOct 21, 2020
  7. Jonathan NiederOct 26, 2020
  8. Junio C HamanoOct 26, 2020
  9. Joey SalazarOct 26, 2020
  10. Jonathan NiederOct 26, 2020
  11. Joey SalazarOct 26, 2020
  12. Joey SalazarOct 27, 2020
  13. Jonathan NiederOct 27, 2020
  14. Joey SalazarOct 27, 2020
  15. Jonathan NiederOct 28, 2020
  16. Joey SalazarOct 28, 2020

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.