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