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

Re: [PATCH 1/4] test-lib-functions: introduce test_line_count_cmd

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2021, 03:01 UTC
Message-ID
<xmqqtum1ywre.fsf@gitster.g>
In-Reply-To
<878s3d286c.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> More generally speaking we have a bunch of helpers that have this
> potential issue/bug, in practice it's not a big deal.  A test that's
> being overly specific and doing a test_cmp on unbounded "find" output or
> whatever is likely buggy anyway.

Unless we are testing ".gitignore", "ls-files -o", or "git status". Carving out $TRASH_DIRECTORY/.git/trash/ directory to store these throwaway files would be less error prone from that point of view.

Show 13 quoted lines
>> +		case "$1" in
>> +		--out)
>> +			outop="$2"
>> +			outval="$3"
>> +			;;
>> +		--err)
>> +			errop="$2"
>> +			errval="$3"
>> +			;;
>
> It looks like the end-state of the series leaves us with no user of the
> --err option; Maybe it's good to have it anyway for completeness, or
> just skip it? ...

I'd rather not to see --out added if we have not yet any use for the other one. When the time comes that we want to validate the error stream, we may find that we want to check _both_, and we'd have to discard dead code and replace with what we want, instead of just adding what we want to a working code without dead code.

Previous: Ævar Arnfjörð BjarmasonNext: Đoàn Trần Công Danh
Message 21 of 22 in “t: new helper test_line_count_cmd”
  1. 0/4 t: new helper test_line_count_cmdĐoàn Trần Công Danh, Jun 12, 2021
  2. 3/4 t6400: use test_line_count_cmd to count # of lines in stdoutĐoàn Trần Công Danh, Jun 12, 2021
  3. Bagas SanjayaJun 12, 2021
  4. Đoàn Trần Công DanhJun 13, 2021
  5. Eric SunshineJun 13, 2021
  6. Đoàn Trần Công DanhJun 13, 2021
  7. 2/4 t6402: use find(1) builtin to filter instead of grepĐoàn Trần Công Danh, Jun 12, 2021
  8. 4/4 t6402: use test_line_count_cmd to count # of lines in stdoutĐoàn Trần Công Danh, Jun 12, 2021
  9. Eric SunshineJun 13, 2021
  10. 1/4 test-lib-functions: introduce test_line_count_cmdĐoàn Trần Công Danh, Jun 12, 2021
  11. Eric SunshineJun 13, 2021
  12. Đoàn Trần Công DanhJun 13, 2021
  13. Ævar Arnfjörð BjarmasonJun 13, 2021
  14. Đoàn Trần Công DanhJun 13, 2021
  15. Phillip WoodJun 13, 2021
  16. Felipe ContrerasJun 13, 2021
  17. Eric SunshineJun 13, 2021
  18. Junio C HamanoJun 14, 2021
  19. Ævar Arnfjörð BjarmasonJun 24, 2021
  20. Ævar Arnfjörð BjarmasonJun 13, 2021
  21. Junio C HamanoJun 14, 2021
  22. Đoàn Trần Công DanhJun 15, 2021

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.