Re: [PATCH 6/6] upload-pack: provide a hook for running pack-objects

2016-05-25 Thread Jeff King
On Thu, May 19, 2016 at 04:54:37PM +0200, Ævar Arnfjörð Bjarmason wrote: > > This is the "could we just set a bool" option I discussed in the commit > > message. The problem is that it doesn't let the admin say "I don't trust > > these repositories, but I _do_ want to run just this one hook when

Re: [PATCH 6/6] upload-pack: provide a hook for running pack-objects

2016-05-19 Thread Ævar Arnfjörð Bjarmason
On Thu, May 19, 2016 at 2:08 PM, Jeff King wrote: > On Thu, May 19, 2016 at 12:12:43PM +0200, Ævar Arnfjörð Bjarmason wrote: >> But as you point out this makes the hook interface a bit unusual. >> Wouldn't this give us the same security and normalize the hook >> interface: >> >> *

Re: [PATCH 6/6] upload-pack: provide a hook for running pack-objects

2016-05-19 Thread Jeff King
On Thu, May 19, 2016 at 12:12:43PM +0200, Ævar Arnfjörð Bjarmason wrote: > On Thu, May 19, 2016 at 12:45 AM, Jeff King wrote: > > 3. You may want to insert a caching layer around > > pack-objects; it is the most CPU- and memory-intensive > > part of serving a fetch,

Re: [PATCH 6/6] upload-pack: provide a hook for running pack-objects

2016-05-19 Thread Ævar Arnfjörð Bjarmason
On Thu, May 19, 2016 at 12:45 AM, Jeff King wrote: > 3. You may want to insert a caching layer around > pack-objects; it is the most CPU- and memory-intensive > part of serving a fetch, and its output is a pure > function[1] of its input, making it an ideal place

Re: [PATCH 6/6] upload-pack: provide a hook for running pack-objects

2016-05-18 Thread Jeff King
On Wed, May 18, 2016 at 06:45:37PM -0400, Jeff King wrote: > @@ -93,6 +94,14 @@ static void create_pack_file(void) > int i; > FILE *pipe_fd; > > + if (!pack_objects_hook) > + pack_objects.git_cmd = 1; > + else { > + argv_array_push(_objects.args,