Kevin Wern <[email protected]> writes:
> Create git-prime-clone, a program to be executed on the server that
> returns the location and type of static resource to download before
> performing the rest of a clone.
>
> Additionally, as this executable's location will be configurable (see:
> upload-pack and receive-pack), add the program to
> BINDIR_PROGRAMS_NEED_X, in addition to the usual builtin places. Add
> git-prime-clone executable to gitignore, as well
>
> Signed-off-by: Kevin Wern <[email protected]>
> ---
I wonder if we even need a separate service like this.
Wouldn't a new protocol capability that is advertised from
upload-pack sufficient to tell the "git clone" that it can
and should consider priming from this static resource?
> +static void prime_clone(void)
> +{
> + if (!enabled) {
> + fprintf(stderr, _("prime-clone not enabled\n"));
> + }
> + else if (url && filetype){
> + packet_write(1, "%s %s\n", filetype, url);
> + }
> + else if (url || filetype) {
> + if (filetype)
> + fprintf(stderr, _("prime-clone not properly "
> + "configured: missing url\n"));
> + else if (url)
> + fprintf(stderr, _("prime-clone not properly "
> + "configured: missing filetype\n"));
> + }
> + packet_flush(1);
> +}
Two minor comments:
- For whom are you going to localize these strings? This program
is running on the server side and we do not know the locale
preferred by the end-user who is sitting on the other end of the
connection, no?
- Turn "}\n\s+else " into "} else ", please.