Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:21

Fredrik Kuivinen [off-list ref] 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)
quoted hunk ↗ jump to hunk
@@ -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)".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help