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

From: Junio C Hamano <[email-masked]>
Date: Thu, 25 Jun 2015 06:14:31 -0700

Johannes Schindelin <[email-masked]> 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.

> - 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.