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

Re: [PATCH 1/2] Git.pm: use array in command_bidi_pipe example

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2024, 20:33 UTC
Message-ID
<xmqq8qz35mxg.fsf@gitster.g>
In-Reply-To
<20240617104326.3522535-2-e@80x24.org>
Eric Wong <e@80x24.org> writes:
> command_bidi_pipe takes the git command and optional arguments as an
> array, not a string.  Make sure the documentation example is usable
> code.
Makes sense.
Show 28 quoted lines
>
> Signed-off-by: Eric Wong <e@80x24.org>
> ---
>  perl/Git.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/perl/Git.pm b/perl/Git.pm
> index 03bf570bf4..aebfe0c6e0 100644
> --- a/perl/Git.pm
> +++ b/perl/Git.pm
> @@ -418,7 +418,7 @@ sub command_bidi_pipe {
>  and it is the fourth value returned by C<command_bidi_pipe()>.  The call idiom
>  is:
>  
> -	my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe('cat-file --batch-check');
> +	my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
>  	print $out "000000000\n";
>  	while (<$in>) { ... }
>  	$r->command_close_bidi_pipe($pid, $in, $out, $ctx);
> @@ -431,7 +431,7 @@ sub command_bidi_pipe {
>  calling this function.  This may be useful in a query-response type of
>  commands where caller first writes a query and later reads response, eg:
>  
> -	my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe('cat-file --batch-check');
> +	my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
>  	print $out "000000000\n";
>  	close $out;
>  	while (<$in>) { ... }
Previous: Eric WongNext: Eric Wong
Message 3 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.