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

Re: What's cooking in git.git (Jun 2015, #06; Wed, 24)

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2015, 13:14 UTC
Message-ID
<xmqqtwtw0w20.fsf@gitster.dls.corp.google.com>
In-Reply-To
<d825b05938778f4ee911cbb8c3c8573b@www.dscho.org>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> - I *think* that the current `recreate_opt()` is fine, but if it
> is used more, we will have to quote the arguments to guard against
> spaces and quotes and whatnot

I admit that that was the reaction I had when I saw it for the first time, until I realized how it is used. And this one I have to disagree. recreate-opt is used to munge a single argument, suitable to be placed into argv[] for execv() like thing---there is no need for shell quoting there. It is a job for the caller that gets its result to shell quote if it wants to pass the result to a shell.

So I think this is fine as-is.
Show 9 quoted lines
> - There is a loop
>
>         for (; *argv; argv++)
>                argv_array_push(array, *argv);
>
>   which might want to be written as
>
>         while (*argv)
>                argv_array_push(array, *(argv)++);

Yeah, the latter is certainly more readable, but I agree this is not a showstopper. I'd gladly take an incremental to update it, though ;-)

Thanks, both.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 7 in “What's cooking in git.git (Jun 2015, #06; Wed, 24)”
  1. Junio C HamanoJun 24, 2015
  2. Stefan BellerJun 25, 2015
  3. Johannes SchindelinJun 25, 2015
  4. Junio C HamanoJun 25, 2015
  5. Johannes SchindelinJun 25, 2015
  6. Tony FinchJun 29, 2015
  7. Torsten BögershausenJun 29, 2015

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.