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

Re: [PATCH v2 2/2] bundle tests: use test_cmp instead of grep

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 22, 2021, 18:17 UTC
Message-ID
<YPm2KsNQxaZTIjGz@nand.local>
In-Reply-To
<patch-2.2-d5504fd764c-20210721T235251Z-avarab@gmail.com>
On Thu, Jul 22, 2021 at 01:53:29AM +0200, Ævar Arnfjörð Bjarmason wrote:
> Change the bundle tests to fully compare the expected "git ls-remote"
> or "git bundle list-heads" output, instead of merely grepping it.

Thanks; this version makes all of those tests more readable. I did have one idle thought while reading, but what you wrote is right (so I'm just thinking out loud as opposed to anything else).

Show 8 quoted lines
> -	sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary &&
> -	grep "^-$OID_REGEX " boundary
> +
> +	if ! test_have_prereq SHA1
> +	then
> +		echo "@object-format=sha256"
> +	fi >expect &&
> +	cat >>expect <<-EOF &&

On my first read, I worried that this 'cat >>expect' when we're in SHA-1 mode would append to the 'expect' we generated a few lines up. But it doesn't, since we redirect the output of the 'if' statement into 'expect' instead of doing the redirect attached to the echo.

Subtle, but that's right. Good.

Thanks, Taylor

Previous: Ævar Arnfjörð BjarmasonNext: Taylor Blau
Message 13 of 14 in “bundle tests: modernize, fix missing coverage & test_cmp”
  1. 0/2 bundle tests: modernize, fix missing coverage & test_cmpÆvar Arnfjörð Bjarmason, Jul 20, 2021
  2. 1/2 bundle tests: use ">file" not ": >file"Ævar Arnfjörð Bjarmason, Jul 20, 2021
  3. Junio C HamanoJul 20, 2021
  4. Felipe ContrerasJul 20, 2021
  5. 2/2 bundle tests: use test_cmp instead of grepÆvar Arnfjörð Bjarmason, Jul 20, 2021
  6. Taylor BlauJul 20, 2021
  7. Ævar Arnfjörð BjarmasonJul 21, 2021
  8. Taylor BlauJul 22, 2021
  9. Taylor BlauJul 20, 2021
  10. 0/2 bundle tests: modernize, fix missing coverage & test_cmpÆvar Arnfjörð Bjarmason, Jul 21, 2021
  11. 1/2 bundle tests: use ">file" not ": >file"Ævar Arnfjörð Bjarmason, Jul 21, 2021
  12. 2/2 bundle tests: use test_cmp instead of grepÆvar Arnfjörð Bjarmason, Jul 21, 2021
  13. Taylor BlauJul 22, 2021
  14. Taylor BlauJul 22, 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.