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

Re: [PATCH v2 2/2] t1006: ensure cat-file info isn't buffered by default

From
Jeff King <peff@peff.net>
Date
Jun 24, 2024, 15:19 UTC
Message-ID
<20240624151906.GB19841@coredump.intra.peff.net>
In-Reply-To
<20240621200002.M726804@dcvr>
On Fri, Jun 21, 2024 at 08:00:02PM +0000, Eric Wong wrote:
Show 14 quoted lines
> > We often use "perl -e" for one-liners, etc, but this is pretty big.
> > Maybe:
> > 
> >   cat >foo.pl <<-\EOF
> >   ...
> >   EOF
> >   perl foo.pl -- ...
> > 
> > would be more readable? To be clear I don't think there's anything
> > incorrect about your usage, but it would match the style of our suite a
> > bit better.
> 
> *shrug*  It doesn't save the nested quoting/expansion confusion;
> but it's Junio's call.  I don't think a v3 is worth the effort.

It does allow you to use single quotes in the script, though I think you managed without it.

Show 8 quoted lines
> > +test_expect_success PERL '--batch-check is unbuffered by default' '
> > +	echo "$hello_oid" |
> > +	perl run-and-wait.pl git cat-file --batch-check >out &&
> > +	echo "$hello_oid blob $hello_size" >expect &&
> > +	test_cmp expect out
> 
> I prefer to avoid process spawning overhead from test_cmp;
> but that's a small drop in a big bucket.

If we care about that, I'd rather see us make test_cmp zero-process with a shell helper than come up with ad-hoc solutions. I've tried to measure something like that before, but couldn't come up with any conclusive improvements (my findings were mostly that running Git itself accounts for most of the process overhead).

-Peff
Previous: Eric WongNext: Junio C Hamano
Message 12 of 16 in “cat-file related doc and test”
  1. 0/2 cat-file related doc and testEric Wong, Jun 17, 2024
  2. 1/2 Git.pm: use array in command_bidi_pipe exampleEric Wong, Jun 17, 2024
  3. Junio C HamanoJun 17, 2024
  4. 2/2 t9700: ensure cat-file info isn't buffered by defaultEric Wong, Jun 17, 2024
  5. Junio C HamanoJun 17, 2024
  6. 2/2 t1006: ensure cat-file info isn't buffered by defaultEric Wong, Jun 18, 2024
  7. Junio C HamanoJun 18, 2024
  8. Eric WongJun 19, 2024
  9. Junio C HamanoJun 20, 2024
  10. Jeff KingJun 21, 2024
  11. Eric WongJun 21, 2024
  12. Jeff KingJun 24, 2024
  13. Junio C HamanoJun 17, 2024
  14. Phillip WoodJun 19, 2024
  15. Eric WongJun 19, 2024
  16. Phillip WoodJun 21, 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.