Git development
 help / color / mirror / Atom feed
* blame not working well?
@ 2006-04-06  0:11 Junio C Hamano
  2006-04-06  1:26 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2006-04-06  0:11 UTC (permalink / raw)
  To: Fredrik Kuivinen; +Cc: git

I was having fun updating blame.c to use the built-in xdiff
instead of spawning and reading from external GNU diff (it is
currently in "next" branch).  It seems to pass the trivial
testsuite case but I noticed for example annotating Makefile,
sha1_name.c, or blame.c in git.git repository seems to show
quite bogus annotation.  One extreme case is the Makefile; for
all but one line is blamed for the very initial commit made by
Linus X-<.  One good news for me is that the version before this
change has the same breakage.  One bad news is this seems to
have been broken for some time.

Bisecting indicates 2a0925be3512451834ec9a3e023f4cff23c1cfb7 is
the first bad commit, but I do not see how the change can break
it.  I'll continue digging it, but if you have a chance, could
you take a look, too?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: blame not working well?
  2006-04-06  0:11 blame not working well? Junio C Hamano
@ 2006-04-06  1:26 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2006-04-06  1:26 UTC (permalink / raw)
  To: Fredrik Kuivinen; +Cc: git

Junio C Hamano <junkio@cox.net> writes:

> I was having fun updating blame.c to use the built-in xdiff
> instead of spawning and reading from external GNU diff (it is
> currently in "next" branch).  It seems to pass the trivial
> testsuite case but I noticed for example annotating Makefile,
> sha1_name.c, or blame.c in git.git repository seems to show
> quite bogus annotation.  One extreme case is the Makefile; for
> all but one line is blamed for the very initial commit made by
> Linus X-<.  One good news for me is that the version before this
> change has the same breakage.  One bad news is this seems to
> have been broken for some time.
>
> Bisecting indicates 2a0925be3512451834ec9a3e023f4cff23c1cfb7 is
> the first bad commit, but I do not see how the change can break
> it.  I'll continue digging it, but if you have a chance, could
> you take a look, too?

It turns out that the only change needed to revert the breakage
was this one-liner.  get_revision() used to always rewrite
parents when prune and dense are specified, but the updated code
simply skips during the output filtering phase the parents that
would have been culled by calling rewrite_parents() unless the
caller tells it that it is interested in the parent field by
setting rev.parents.

-- >8 --
[PATCH] blame.c: fix completely broken ancestry traversal.

Recent revision.c updates completely broken the assignment of
blames by not rewriting commit->parents field unless explicitly
asked to by the caller.  The caller needs to set revs.parents.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

ba3c93743a8151e3663e1fda6b3cb165d8373ddf
diff --git a/blame.c b/blame.c
index 98f9992..9bb34e6 100644
--- a/blame.c
+++ b/blame.c
@@ -813,6 +813,7 @@ int main(int argc, const char **argv)
 	rev.prune_fn = simplify_commit;
 	rev.topo_setter = topo_setter;
 	rev.topo_getter = topo_getter;
+	rev.parents = 1;
 	rev.limited = 1;
 
 	commit_list_insert(start_commit, &rev.commits);
-- 
1.3.0.rc2.g9cda

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-06  1:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-06  0:11 blame not working well? Junio C Hamano
2006-04-06  1:26 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox