Re: [PATCH v2 4/4] describe: Delay looking up commits until searching for an inexact match

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Anders Kaseorg
Date: Wednesday, December 8, 2010 - 4:47 pm

On Wed, 8 Dec 2010, Junio C Hamano wrote:

Yes; the problem now is that, in order to avoid calling replace_name() 
excessively, I need to resolve all multiply-tagged commits in one pass, 
before I have those commits in the obj_hash.  This could have been done 
with the linked list by deleting any commit_name from the linked list the 
first time replace_name() decides it should be superseded by a different 
commit_name, but the hash table approach seems less fragile to me.  The 
hash table also has the advantage of avoiding the O(#tags * #arguments) 
complexity when describe is given many arguments.

Let me know if you’d like me to try it the other way.


Oh right.  I’ll fix that.

static int set_util(void *chain)
{
	struct commit_name *n;
	for (n = chain; n; n = n->next) {
		struct commit *c = lookup_commit_reference_gently(n->peeled, 1);
		if (c)
			c->util = n;
	}
	return 0;
}


I’ll fix that too.

static inline unsigned int hash_sha1(const unsigned char *sha1)
{
	unsigned int hash;
	memcpy(&hash, sha1, sizeof(hash));
	return hash;
}

Anders
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] describe: Use for_each_rawref, Anders Kaseorg, (Tue Dec 7, 11:22 am)
Re: [PATCH 1/2] describe: Use for_each_rawref, Anders Kaseorg, (Tue Dec 7, 11:26 am)
Re: [PATCH 1/2] describe: Use for_each_rawref, Junio C Hamano, (Tue Dec 7, 12:49 pm)
Re: [PATCH 1/2] describe: Use for_each_rawref, Junio C Hamano, (Tue Dec 7, 2:59 pm)
[PATCH v2 1/4] describe: Use for_each_rawref, Anders Kaseorg, (Tue Dec 7, 9:42 pm)
Re: [PATCH v2 4/4] describe: Delay looking up commits unti ..., Anders Kaseorg, (Wed Dec 8, 4:47 pm)
[PATCH v3 1/4] describe: Use for_each_rawref, Anders Kaseorg, (Wed Dec 8, 11:42 pm)