Re: [PATCH 01/11] Resumable clone: create service git-prime-clone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin Wern <kevin.m.wern@xxxxxxxxx> 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 <kevin.m.wern@xxxxxxxxx>
> ---

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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]