{"thread":{"id":"18369","subject":"[PATCH] blame: read custom grafts given by -S before calling setup_revisions()","startedAt":"2009-03-18T07:50:56Z","lastAt":"2009-03-18T07:50:56Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"108353","messageId":"7viqm7l15r.fsf@gitster.siamese.dyndns.org","threadId":"18369","inReplyTo":null,"subject":"[PATCH] blame: read custom grafts given by -S before calling setup_revisions()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-18T07:50:56Z","receivedAt":"2009-03-18T07:50:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"setup_revisions() while getting the command line arguments parses the\ngiven commits from the command line, which means their direct parents will\nnot be rewritten by the custom graft file.\n\nCall read_ancestry() early to work around this issue.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-blame.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 4ea3431..0c241a9 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -2346,6 +2346,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n parse_done:\n \targc = parse_options_end(&ctx);\n \n+\tif (revs_file && read_ancestry(revs_file))\n+\t\tdie(\"reading graft file %s failed: %s\",\n+\t\t    revs_file, strerror(errno));\n+\n \tif (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))\n \t\topt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |\n \t\t\tPICKAXE_BLAME_COPY_HARDER);\n@@ -2484,10 +2488,6 @@ parse_done:\n \tsb.ent = ent;\n \tsb.path = path;\n \n-\tif (revs_file && read_ancestry(revs_file))\n-\t\tdie(\"reading graft file %s failed: %s\",\n-\t\t    revs_file, strerror(errno));\n-\n \tread_mailmap(&mailmap, \".mailmap\", NULL);\n \n \tif (!incremental)\n-- \n1.6.2.1.278.g7b6274e\n"}]}