{"thread":{"id":"3807","subject":"blame not working well?","startedAt":"2006-04-06T00:11:47Z","lastAt":"2006-04-06T01:26:11Z","messageCount":2,"participants":["Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18412","messageId":"7vacazy33w.fsf@assigned-by-dhcp.cox.net","threadId":"3807","inReplyTo":null,"subject":"blame not working well?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-06T00:11:47Z","receivedAt":"2006-04-06T00:11:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I was having fun updating blame.c to use the built-in xdiff\ninstead of spawning and reading from external GNU diff (it is\ncurrently in \"next\" branch).  It seems to pass the trivial\ntestsuite case but I noticed for example annotating Makefile,\nsha1_name.c, or blame.c in git.git repository seems to show\nquite bogus annotation.  One extreme case is the Makefile; for\nall but one line is blamed for the very initial commit made by\nLinus X-<.  One good news for me is that the version before this\nchange has the same breakage.  One bad news is this seems to\nhave been broken for some time.\n\nBisecting indicates 2a0925be3512451834ec9a3e023f4cff23c1cfb7 is\nthe first bad commit, but I do not see how the change can break\nit.  I'll continue digging it, but if you have a chance, could\nyou take a look, too?\n"},{"id":"18414","messageId":"7vwte3wl3g.fsf@assigned-by-dhcp.cox.net","threadId":"3807","inReplyTo":"7vacazy33w.fsf@assigned-by-dhcp.cox.net","subject":"Re: blame not working well?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-06T01:26:11Z","receivedAt":"2006-04-06T01:26:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> I was having fun updating blame.c to use the built-in xdiff\n> instead of spawning and reading from external GNU diff (it is\n> currently in \"next\" branch).  It seems to pass the trivial\n> testsuite case but I noticed for example annotating Makefile,\n> sha1_name.c, or blame.c in git.git repository seems to show\n> quite bogus annotation.  One extreme case is the Makefile; for\n> all but one line is blamed for the very initial commit made by\n> Linus X-<.  One good news for me is that the version before this\n> change has the same breakage.  One bad news is this seems to\n> have been broken for some time.\n>\n> Bisecting indicates 2a0925be3512451834ec9a3e023f4cff23c1cfb7 is\n> the first bad commit, but I do not see how the change can break\n> it.  I'll continue digging it, but if you have a chance, could\n> you take a look, too?\n\nIt turns out that the only change needed to revert the breakage\nwas this one-liner.  get_revision() used to always rewrite\nparents when prune and dense are specified, but the updated code\nsimply skips during the output filtering phase the parents that\nwould have been culled by calling rewrite_parents() unless the\ncaller tells it that it is interested in the parent field by\nsetting rev.parents.\n\n-- >8 --\n[PATCH] blame.c: fix completely broken ancestry traversal.\n\nRecent revision.c updates completely broken the assignment of\nblames by not rewriting commit->parents field unless explicitly\nasked to by the caller.  The caller needs to set revs.parents.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n blame.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\nba3c93743a8151e3663e1fda6b3cb165d8373ddf\ndiff --git a/blame.c b/blame.c\nindex 98f9992..9bb34e6 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -813,6 +813,7 @@ int main(int argc, const char **argv)\n \trev.prune_fn = simplify_commit;\n \trev.topo_setter = topo_setter;\n \trev.topo_getter = topo_getter;\n+\trev.parents = 1;\n \trev.limited = 1;\n \n \tcommit_list_insert(start_commit, &rev.commits);\n-- \n1.3.0.rc2.g9cda\n"}]}