Re: [PATCH 02/11] Resumable clone: add prime-clone endpoints

2016-09-27 Thread Kevin Wern
On Mon, Sep 19, 2016 at 08:15:00PM +0700, Duy Nguyen wrote:
> We also have an exception for select_getanyfile() below. I think it's
> time we add a function callback in struct rpc_service to run each
> service the way they want. Then prime-clone won't need an exception
> (neither does select_anyfile, mostly)
> -- 
> Duy

Great idea! I'll definitely do that if we decide to go with the service I
implemented.


Re: [PATCH 02/11] Resumable clone: add prime-clone endpoints

2016-09-19 Thread Duy Nguyen
On Fri, Sep 16, 2016 at 7:12 AM, Kevin Wern  wrote:
>  static struct daemon_service daemon_service[] = {
> { "upload-archive", "uploadarch", upload_archive, 0, 1 },
> { "upload-pack", "uploadpack", upload_pack, 1, 1 },
> { "receive-pack", "receivepack", receive_pack, 0, 1 },
> +   { "prime-clone", "primeclone", prime_clone, 0, 1 },
>  };

I guess this is why you chose to implement a new command in 01/11,
simpler to be called from http-backend?

> +   // prime-clone does not need --stateless-rpc and
> +   // --advertise-refs options. Maybe it will in the future, but
> +   // until then it seems best to do this instead of adding
> +   // "dummy" options.

Stick to /* .. */

> +   if (strcmp(svc->name, "prime-clone") != 0) {
> +   argv_array_pushl(&argv, "--stateless-rpc",
> +"--advertise-refs", NULL);
> +   }

We also have an exception for select_getanyfile() below. I think it's
time we add a function callback in struct rpc_service to run each
service the way they want. Then prime-clone won't need an exception
(neither does select_anyfile, mostly)
-- 
Duy