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

Re: [PATCH v2] tests: modernize the test script t0010-racy-git.sh

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 29, 2024, 23:36 UTC
Message-ID
<xmqqa5nic06t.fsf@gitster.g>
In-Reply-To
<CAPig+cQ5m86=pLTpFrik0xS6XPyK4tZQx_wkc1xh2r9WDFkhuQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 18 quoted lines
> On Thu, Feb 29, 2024 at 6:14 PM Junio C Hamano <gitster@pobox.com> wrote:
>> So, we may want to do it more like this, perhaps?
>>
>>         test_expect_success "Racy GIT trial #$trial part A" '
>>                 rm -f .git/index &&
>>                 echo frotz >infocom &&
>>                 git update-index --add infocom &&
>>                 echo xyzzy >infocom &&
>>
>>                 files=$(git diff-files -p) &&
>>                 test "" != "$files"
>>         '
>
> If taking it to this extent, then the modernized version of the last
> couple lines would be:
>
>     git diff-files -p >out &&
>     test_file_not_empty out

Yes. The modern style seems to prefer temporary files over variables; the reason probably is because it tends to be easier to remotely post-mortem?

Previous: Eric SunshineNext: Eric Sunshine
Message 7 of 18 in “tests: modernize the test script t0010-racy-git.sh”
  1. tests: modernize the test script t0010-racy-git.shAryan Gupta via GitGitGadget, Feb 29, 2024
  2. Eric SunshineFeb 29, 2024
  3. tests: modernize the test script t0010-racy-git.shAryan Gupta via GitGitGadget, Feb 29, 2024
  4. Eric SunshineFeb 29, 2024
  5. Junio C HamanoFeb 29, 2024
  6. Eric SunshineFeb 29, 2024
  7. Junio C HamanoFeb 29, 2024
  8. Eric SunshineFeb 29, 2024
  9. Eric SunshineMar 1, 2024
  10. Junio C HamanoMar 1, 2024
  11. tests: modernize the test script t0010-racy-git.shAryan Gupta via GitGitGadget, Mar 5, 2024
  12. Junio C HamanoMar 5, 2024
  13. tests: modernize the test script t0010-racy-git.shAryan Gupta via GitGitGadget, Mar 6, 2024
  14. Christian CouderMar 7, 2024
  15. Aryan GuptaMar 7, 2024
  16. Junio C HamanoMar 7, 2024
  17. Junio C HamanoMar 7, 2024
  18. Aryan GuptaMar 7, 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.