From: Johannes Schindelin Date: Fri, 27 Jun 2008 17:46:43 GMT Subject: Re: [PATCH] commit-tree: lift completely arbitrary limit of 16 parents Message-ID: In-Reply-To: <7v7icassr8.fsf@gitster.siamese.dyndns.org> Hi, On Fri, 27 Jun 2008, Junio C Hamano wrote: > Johannes Schindelin writes: > > > -static int new_parent(int idx) > > +static void new_parent(struct commit *parent, struct commit_list **parents_p) > > { > > - int i; > > - unsigned char *sha1 = parent_sha1[idx]; > > - for (i = 0; i < idx; i++) { > > - if (!hashcmp(parent_sha1[i], sha1)) { > > + unsigned char *sha1 = parent->object.sha1; > > + struct commit_list *parents; > > + for (parents = *parents_p; parents; parents = parents->next) { > > + if (!hashcmp(parents->item->object.sha1, sha1)) { > > Wouldn't it be enough to compare (parents->item == parent)? Probably, since we now use lookup_commit(). Feel free to change. > > @@ -69,18 +63,16 @@ int cmd_commit_tree(int argc, const char **argv, > > const char *prefix) > > > > check_valid(tree_sha1, OBJ_TREE); > > for (i = 2; i < argc; i += 2) { > > + unsigned char sha1[40]; > > s/4/2/; Yes, I admitted that already in response to Hannes. Mea culpa, mea maxima culpa. Sorry, Dscho