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

Re: [PATCH 0/3] Teach git-blame about renames

From
Junio C Hamano <junkio@cox.net>
Date
Mar 9, 2006, 00:27 UTC
Message-ID
<7v4q28h38p.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060308225412.GA461@c165.ib.student.liu.se>
Fredrik Kuivinen <freku045@student.liu.se> writes:
(from part 1/3)
Show 10 quoted lines
> +void default_setter(struct commit* c, void* data)
> +{
> +	c->object.util = data;
> +}
> +
> +void* default_getter(struct commit* c)
> +{
> +	return c->object.util;
> +}
> +
These names are too generic to be used as a global.
The rest of the git code tends to say "void *default_getter()".
(from part 2/3)
Show 9 quoted lines
> @@ -224,7 +224,7 @@ static struct commit_list *find_bisectio
>  	nr = 0;
>  	p = list;
>  	while (p) {
> -		if (!revs.paths || (p->item->object.flags & TREECHANGE))
> +		if (!revs.prune_data || (p->item->object.flags & TREECHANGE))
>  			nr++;
>  		p = p->next;
>  	}

Here you test with revs.prune_data, but the rest you test with revs.prune_fn. It is conceivable that some prune_fn could be written without using prune_data, so I'd suggest to check consistently with prune_fn.

Show 5 quoted lines
> -static int compare_tree(struct tree *t1, struct tree *t2)
> +int compare_tree(struct tree *t1, struct tree *t2)
> ...
> -static int same_tree_as_empty(struct tree *t1)
> +int same_tree_as_empty(struct tree *t1)
Maybe the names are a bit too generic to be used as a global?
> -	if (revs->paths)
> +	/* if (revs->paths)
>  		try_to_simplify_commit(revs, commit);
> +	*/
Leftover commenting.
(from part 3/3)
Show 7 quoted lines
> -	struct util_info *util;
> -	if (commit->object.util)
> -		return 0;
> +	struct util_info *util = commit->object.util;
> +
> +	if(util)
> +		return util;
The rest of the git code tends to say "if (util)".
Previous: Fredrik KuivinenNext: Fredrik Kuivinen
Message 5 of 6 in “Teach git-blame about renames”
  1. 0/3 Teach git-blame about renamesFredrik Kuivinen, Mar 8, 2006
  2. 1/3 Make it possible to not clobber object.util in sort_in_topological_orderFredrik Kuivinen, Mar 8, 2006
  3. 2/3 rev-lib: Make it easy to do rename trackingFredrik Kuivinen, Mar 8, 2006
  4. 3/3 blame: Rename detectionFredrik Kuivinen, Mar 8, 2006
  5. Junio C HamanoMar 9, 2006
  6. Fredrik KuivinenMar 9, 2006

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.