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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fredrik Kuivinen <freku045@xxxxxxxxxxxxxx> writes:

(from part 1/3)

> +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)

> @@ -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.

> -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)

> -	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)".


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]