git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] commit-tree: lift completely arbitrary limit of 16 parents

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 27, 2008, 17:46 UTC
Message-ID
<alpine.DEB.1.00.0806271845450.9925@racer>
In-Reply-To
<7v7icassr8.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 27 Jun 2008, Junio C Hamano wrote:
Show 15 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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.
Show 8 quoted lines
> > @@ -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

Previous: Junio C Hamano
Message 9 of 9 in “octopus limit”
  1. Len BrownJun 27, 2008
  2. Matthieu MoyJun 27, 2008
  3. Miklos VajnaJun 27, 2008
  4. Johannes SchindelinJun 27, 2008
  5. commit-tree: lift completely arbitrary limit of 16 parentsJohannes Schindelin, Jun 27, 2008
  6. Johannes SixtJun 27, 2008
  7. Johannes SchindelinJun 27, 2008
  8. Junio C HamanoJun 27, 2008
  9. Johannes SchindelinJun 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.