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

Re: [PATCH] cvsimport: modernize and standardize external tool calling

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 17, 2010, 19:15 UTC
Message-ID
<7v8wbwzgnw.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1263749749-3939-1-git-send-email-bwalton@artsci.utoronto.ca>
Ben Walton <bwalton@artsci.utoronto.ca> writes:
Show 8 quoted lines
> The cvsimport module was mixing old (git-foo) and new (git foo)
> conventions when calling git tools.  This patch standardizes the
> calling conventions used in system(), open(), exec() and backticks.
>
> Reported-by: Alexander Maier <amaier@opencsw.org>
> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
> ---
> This takes into account the feedback from Junio.
Hmph...
> -	open(my $fh, '|-', qw(git-update-index -z --index-info))
> -		or die "unable to open git-update-index: $!";
> +	open(my $fh, '|-', 'git update-index -z --index-info')
> +		or die "unable to open git update-index: $!";
I think this change is backwards (and there probably are others).

It used to use a shell-less one-element-per-argument list form to spawn the process that reads from the pipe, but now you are passing a single string to be split by the shell.

How about doing this as a two (perhaps three?) patch series instead?
 (1) s/git-foo/git foo/ and _nothing else_;
 (2) s/open fh, '|-', 'string'/open fh, '|-', qw(string)/ and
     s/system 'string'/system qw(string)/.
Previous: Ben WaltonNext: Ben Walton
Message 3 of 6 in “cvsimport: update to use non-dash git commands”
  1. cvsimport: update to use non-dash git commandsBen Walton, Jan 17, 2010
  2. cvsimport: modernize and standardize external tool callingBen Walton, Jan 17, 2010
  3. Junio C HamanoJan 17, 2010
  4. 1/3 cvsimport: modernize callouts to git subcommandsBen Walton, Jan 19, 2010
  5. 2/3 cvsimport: standarize open() calls to external git toolsBen Walton, Jan 19, 2010
  6. 3/3 cvsimport: standarize system() calls to external git toolsBen Walton, Jan 19, 2010

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.