Re: [RFC PATCH v7 3/3] git-remote-ext
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 13, 2010, 23:32 UTC
- Message-ID
- <7v7hhlhdnt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1286901583-30088-4-git-send-email-ilari.liusvaara@elisanet.fi>
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
Show 14 quoted lines
> +'%G<repository>' (as argument):: > + This argument will not be passed to 'program'. Instead, it > + will cause helper to start by sending git:// service request to > + remote side with service field set to approiate value and > + repository field set to <repository>. Default is not to send > + such request. > ++ > +This is useful if remote side is git:// server accessed over > +some tunnel. > + > +'%V<host>' (as argument):: > + This argument will not be passed to 'program'. Instead it sets > + the vhost field in git:// service request. Default is not to > + send vhost in such request (if sent).
The above does not say anything about being the first 'character' in an argument, like the in-code comment does. Is that intended?
Show 22 quoted lines
> +static const char **parse_argv(const char *arg, const char *service)
> +{
> + int arguments = 0;
> + int i;
> + const char **ret;
> + char *temparray[MAXARGUMENTS + 1];
> +
> + while (*arg) {
> + char *expanded;
> + if (arguments == MAXARGUMENTS)
> + die("remote-ext command has too many arguments");
> + expanded = strip_escapes(arg, service, &arg);
> + if (expanded)
> + temparray[arguments++] = expanded;
> + }
> +
> + ret = xmalloc((arguments + 1) * sizeof(char *));
> + for (i = 0; i < arguments; i++)
> + ret[i] = temparray[i];
> + ret[arguments] = NULL;
> + return (const char **)ret;
> +}Isn't "ret" declared to be of that type?