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

[PATCH 5/5] Avoid queuing commits multiple times for the same origin

From
David Kastrup <dak@gnu.org>
Date
Feb 3, 2014, 19:14 UTC
Message-ID
<1391454849-26558-6-git-send-email-dak@gnu.org>
In-Reply-To
<1391454849-26558-1-git-send-email-dak@gnu.org>
---
 builtin/blame.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index 0188115..80345db 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -928,9 +928,12 @@ static int pass_blame_to_parent(struct scoreboard *sb,
 	/* The rest are the same as the parent */
 	blame_chunk(&d.dstq, &d.srcq, INT_MAX, d.offset, INT_MAX, target, parent);
 	*d.dstq = NULL;
-	parent->suspects = blame_merge(parent->suspects, newdest);
 	if (parent->suspects)
+		parent->suspects = blame_merge(parent->suspects, newdest);
+	else if (newdest) {
+		parent->suspects = newdest;
 		prio_queue_put(&sb->commits, parent->commit);
+	}
 
 	return 0;
 }
@@ -1303,8 +1306,12 @@ static void pass_whole_blame(struct scoreboard *sb,
 		origin_decref(e->suspect);
 		e->suspect = porigin;
 	}
-	porigin->suspects = blame_merge(porigin->suspects, suspects);
-	prio_queue_put(&sb->commits, porigin->commit);
+	if (porigin->suspects)
+		porigin->suspects = blame_merge(porigin->suspects, suspects);
+	else if (suspects) {
+		porigin->suspects = suspects;
+		prio_queue_put(&sb->commits, porigin->commit);
+	}
 }
 
 /*
-- 
1.8.3.2
Previous: David Kastrup
Message 6 of 6 in “git-blame: further performance preview”
  1. 0/5 git-blame: further performance previewDavid Kastrup, Feb 3, 2014
  2. 1/5 builtin/blame.c: struct blame_entry does not need a prev linkDavid Kastrup, Feb 3, 2014
  3. 2/5 Eliminate same_suspect function in builtin/blame.cDavid Kastrup, Feb 3, 2014
  4. 3/5 builtin/blame.c: large-scale rewriteDavid Kastrup, Feb 3, 2014
  5. 4/5 Performance improvement: don't drop origin blobs that are going to get tested next.David Kastrup, Feb 3, 2014
  6. 5/5 Avoid queuing commits multiple times for the same originDavid Kastrup, Feb 3, 2014

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.