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

[PATCH] blame: read custom grafts given by -S before calling setup_revisions()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 18, 2009, 07:50 UTC
Message-ID
<7viqm7l15r.fsf@gitster.siamese.dyndns.org>

setup_revisions() while getting the command line arguments parses the given commits from the command line, which means their direct parents will not be rewritten by the custom graft file.

Call read_ancestry() early to work around this issue.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin-blame.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index 4ea3431..0c241a9 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2346,6 +2346,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 parse_done:
 	argc = parse_options_end(&ctx);
 
+	if (revs_file && read_ancestry(revs_file))
+		die("reading graft file %s failed: %s",
+		    revs_file, strerror(errno));
+
 	if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
 		opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
 			PICKAXE_BLAME_COPY_HARDER);
@@ -2484,10 +2488,6 @@ parse_done:
 	sb.ent = ent;
 	sb.path = path;
 
-	if (revs_file && read_ancestry(revs_file))
-		die("reading graft file %s failed: %s",
-		    revs_file, strerror(errno));
-
 	read_mailmap(&mailmap, ".mailmap", NULL);
 
 	if (!incremental)
-- 
1.6.2.1.278.g7b6274e
Message 1 of 1 in “blame: read custom grafts given by -S before calling setup_revisions()”
  1. blame: read custom grafts given by -S before calling setup_revisions()Junio C Hamano, Mar 18, 2009

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.