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

[PATCH] blame: drop unused parameter from maybe_changed_path

From
Jeff King <peff@peff.net>
Date
Apr 23, 2020, 21:03 UTC
Message-ID
<20200423210303.GA1635761@coredump.intra.peff.net>

We don't use the "parent" parameter at all (probably because the bloom filter for a commit is always defined against a single parent anyway).

Signed-off-by: Jeff King <peff@peff.net>
---
This is on top of ds/blame-on-bloom, which just made it to next.

I _think_ this is the right solution, but perhaps the function should be verifying that we're looking at the right parent?

 blame.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/blame.c b/blame.c
index 9fbf79e47c..da7e28800e 100644
--- a/blame.c
+++ b/blame.c
@@ -1263,7 +1263,6 @@ struct blame_bloom_data {
 static int bloom_count_queries = 0;
 static int bloom_count_no = 0;
 static int maybe_changed_path(struct repository *r,
-			      struct commit *parent,
 			      struct blame_origin *origin,
 			      struct blame_bloom_data *bd)
 {
@@ -1355,8 +1354,7 @@ static struct blame_origin *find_origin(struct repository *r,
 		if (origin->commit->parents &&
 		    !oidcmp(&parent->object.oid,
 			    &origin->commit->parents->item->object.oid))
-			compute_diff = maybe_changed_path(r, parent,
-							  origin, bd);
+			compute_diff = maybe_changed_path(r, origin, bd);
 
 		if (compute_diff)
 			diff_tree_oid(get_commit_tree_oid(parent),
-- 
2.26.2.827.g3c1233342b
Next: Junio C Hamano
Message 1 of 4 in “blame: drop unused parameter from maybe_changed_path”
  1. blame: drop unused parameter from maybe_changed_pathJeff King, Apr 23, 2020
  2. Junio C HamanoApr 23, 2020
  3. Jeff KingApr 24, 2020
  4. Junio C HamanoApr 24, 2020

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.