Re: [PATCH v2 1/3] serialize collection of changed submodules

2016-10-13 Thread Heiko Voigt
On Wed, Oct 12, 2016 at 10:18:28AM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > Which seems quite extensively long for a static function so how about > > we shorten it a bit and add a comment: > > > > /* lookup or create commit object list for submodule */ > > get_commit_objec

Re: [PATCH v2 1/3] serialize collection of changed submodules

2016-10-12 Thread Junio C Hamano
Heiko Voigt writes: > Which seems quite extensively long for a static function so how about > we shorten it a bit and add a comment: > > /* lookup or create commit object list for submodule */ > get_commit_objects_for_submodule_path(... Or you can even lose "get_" and "path", I guess

Re: [PATCH v2 1/3] serialize collection of changed submodules

2016-10-12 Thread Heiko Voigt
On Mon, Oct 10, 2016 at 03:43:13PM -0700, Junio C Hamano wrote: > Stefan Beller writes: > > >> +static struct sha1_array *get_sha1s_from_list(struct string_list > >> *submodules, > >> + const char *path) > > > > So this will take the stringlist `submodules` and insert the path into

Re: [PATCH v2 1/3] serialize collection of changed submodules

2016-10-12 Thread Heiko Voigt
On Fri, Oct 07, 2016 at 10:59:29AM -0700, Stefan Beller wrote: > On Fri, Oct 7, 2016 at 8:06 AM, Heiko Voigt wrote: > > +static void free_submodules_sha1s(struct string_list *submodules) > > +{ > > + int i; > > + for (i = 0; i < submodules->nr; i++) { > > + struct string_

Re: [PATCH v2 1/3] serialize collection of changed submodules

2016-10-10 Thread Junio C Hamano
Stefan Beller writes: >> +static struct sha1_array *get_sha1s_from_list(struct string_list >> *submodules, >> + const char *path) > > So this will take the stringlist `submodules` and insert the path into it, > if it wasn't already in there. In case it is newly inserted, add a sha1

Re: [PATCH v2 1/3] serialize collection of changed submodules

2016-10-07 Thread Stefan Beller
On Fri, Oct 7, 2016 at 8:06 AM, Heiko Voigt wrote: > To check whether a submodule needs to be pushed we need to collect all > changed submodules. Lets collect them first and then execute the > possibly expensive test whether certain revisions are already pushed > only once per submodule. > > There

[PATCH v2 1/3] serialize collection of changed submodules

2016-10-07 Thread Heiko Voigt
To check whether a submodule needs to be pushed we need to collect all changed submodules. Lets collect them first and then execute the possibly expensive test whether certain revisions are already pushed only once per submodule. There is further potential for optimization since we can assemble on