Thread (1 message) 1 message, 1 author, 2020-08-05

Re: [PATCH 2/6] revision: parse parent in indegree_walk_step()

From: Jakub Narębski <hidden>
Date: 2020-08-05 23:16:24

"Abhishek Kumar via GitGitGadget" [off-list ref] writes:
quoted hunk
From: Abhishek Kumar <redacted>

In indegree_walk_step(), we add unvisited parents to the indegree queue.
However, parents are not guaranteed to be parsed. As the indegree queue
sorts by generation number, let's parse parents before inserting them to
ensure the correct priority order.

Signed-off-by: Abhishek Kumar <redacted>
---
 revision.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/revision.c b/revision.c
index 6aa7f4f567..23287d26c3 100644
--- a/revision.c
+++ b/revision.c
@@ -3343,6 +3343,9 @@ static void indegree_walk_step(struct rev_info *revs)
 		struct commit *parent = p->item;
 		int *pi = indegree_slab_at(&info->indegree, parent);

+		if (parse_commit_gently(parent, 1) < 0)
All right, parse_commit_gently() avoids re-parsing objects, and makes
use of the commit-graph data.  If parents are not guaranteed to be
parsed, this is a correct thing to do.

Though I do wonder how this issue got missed by the test suite, just
like other reviewers...
+			return ;
Why this need to be 'return' and not 'continue'?
+
 		if (*pi)
 			(*pi)++;
 		else
Best,
-- 
Jakub Narębski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help