Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-10 Thread Stefan Beller
On Fri, Aug 7, 2015 at 11:20 PM, Junio C Hamano wrote: > Junio C Hamano writes: > ... if you really want to go the "thread" route, the first thing to try would be to see if a few places we already use threads for parallelism (namely, "grep", "pack-objects", "preload-index" and

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Junio C Hamano writes: >>> ... if >>> you really want to go the "thread" route, the first thing to try >>> would be to see if a few places we already use threads for >>> parallelism (namely, "grep", "pack-objects", "preload-index" and >>> "index-pack") can be factored out and model your new API a

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Stefan Beller writes: >> One more thing, as I didn't notice that you kept repeating "thread" >> pool API. > > Yeah I intended to use both threads and processes for the heavy submodule > operations. OK. I somehow had an impression that it might be more tricky than it is worth to spawn/run_comman

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Stefan Beller
On Fri, Aug 7, 2015 at 3:42 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> That's why I want to be a bit more generic and have this thread pool API >> done in C, such that "any for loop" in git can be easily replaced by using >> the thread pool. I think of "git fetch --all" specially. > >

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Stefan Beller
On Fri, Aug 7, 2015 at 3:18 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Fri, Aug 7, 2015 at 2:32 PM, Junio C Hamano wrote: >> > If we followed what you just said, that patch will try to directly > read the data in config_name_for_path string list, which is removed > by

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Stefan Beller writes: > That's why I want to be a bit more generic and have this thread pool API > done in C, such that "any for loop" in git can be easily replaced by using > the thread pool. I think of "git fetch --all" specially. One more thing, as I didn't notice that you kept repeating "thr

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Aug 7, 2015 at 2:32 PM, Junio C Hamano wrote: > If we followed what you just said, that patch will try to directly read the data in config_name_for_path string list, which is removed by Heiko's series, if I am reading it right. >> >> By the way, the

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Stefan Beller
On Fri, Aug 7, 2015 at 2:32 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Fri, Aug 7, 2015 at 2:14 PM, Junio C Hamano wrote: >>> Stefan Beller writes: ... We can drop that hunk as it only uses the new method `submodule_name_for_path` but doesn't change functionality.

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Aug 7, 2015 at 2:14 PM, Junio C Hamano wrote: >> Stefan Beller writes: >>> ... >>> We can drop that hunk as it only uses the new method >>> `submodule_name_for_path` but doesn't change functionality. >>> So if you want to keep Heikos work, I'll just resend the pa

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Stefan Beller
On Fri, Aug 7, 2015 at 2:14 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Fri, Aug 7, 2015 at 1:17 PM, Junio C Hamano wrote: >>> Jens Lehmann writes: >>> >>> This change... >>> > @@ -723,10 +733,8 @@ int fetch_populated_submodules(const struct > argv_array *options, >

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Aug 7, 2015 at 1:17 PM, Junio C Hamano wrote: >> Jens Lehmann writes: >> >> This change... >> @@ -723,10 +733,8 @@ int fetch_populated_submodules(const struct argv_array *options, if (!S_ISGITLINK(ce->ce_mode))

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Stefan Beller
On Fri, Aug 7, 2015 at 1:03 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> This incorporates the changes from Jens fixup! commit >> (which addresses all issues he pointed out). >> >> I agree this looks much cleaner. :) > > The only thing I found somewhat questionable is where to call > gi

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Stefan Beller
On Fri, Aug 7, 2015 at 1:17 PM, Junio C Hamano wrote: > Jens Lehmann writes: > > This change... > >>> @@ -723,10 +733,8 @@ int fetch_populated_submodules(const struct argv_array >>> *options, >>> if (!S_ISGITLINK(ce->ce_mode)) >>> continue; >>> >>> -

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Jens Lehmann writes: This change... >> @@ -723,10 +733,8 @@ int fetch_populated_submodules(const struct argv_array >> *options, >> if (!S_ISGITLINK(ce->ce_mode)) >> continue; >> >> -name = ce->name; >> -name_for_path = >> unsorted_strin

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-07 Thread Junio C Hamano
Stefan Beller writes: > This incorporates the changes from Jens fixup! commit > (which addresses all issues he pointed out). > > I agree this looks much cleaner. :) The only thing I found somewhat questionable is where to call gitmodules_config() from. I think it is OK to do this at the beginni

[PATCH] submodule: implement `module_name` as a builtin helper

2015-08-06 Thread Stefan Beller
This implements the helper `module_name` in C instead of shell, yielding a nice performance boost. Before this patch, I measured a time (best out of three): $ time ./t7400-submodule-basic.sh >/dev/null real0m11.066s user0m3.348s sys 0m8.534s With this patch applied

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-06 Thread Jens Lehmann
Am 05.08.2015 um 23:08 schrieb Stefan Beller: This implements the helper `module_name` in C instead of shell, yielding a nice performance boost. Before this patch, I measured a time (best out of three): $ time ./t7400-submodule-basic.sh >/dev/null real 0m11.066s user 0

[PATCH] submodule: implement `module_name` as a builtin helper

2015-08-05 Thread Stefan Beller
This implements the helper `module_name` in C instead of shell, yielding a nice performance boost. Before this patch, I measured a time (best out of three): $ time ./t7400-submodule-basic.sh >/dev/null real0m11.066s user0m3.348s sys 0m8.534s With this patch applied