From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: Re: On blame/pickaxe
Date: Sat, 14 Oct 2006 03:26:43 -0700 [thread overview]
Message-ID: <7vwt739org.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vr6xddm7h.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 12 Oct 2006 18:43:46 -0700")
Junio C Hamano <junkio@cox.net> writes:
> 4. Passing more blame.
>
> Instead of taking responsibility for the remainder, there are
> other ways to find other people to pass blame on. That's what
> the "NEEDSWORK" comment in pass_blame() is about.
I've spent a few hours tonight to further work (eh, "have fun")
on this. The version at the tip of "pu" implements detection of
a case like this:
> A typical example is a change that moves one static C function
> from lower part of the file to upper part of the same file,
> because you added a new caller in the middle. The path in your
> parent and the path in you would look like this:
>
> parent you
>
> A static foo() {
> B }
> C A
> D B
> E C
> F D
> G ... call foo();
> static foo() { E
> } F
> I G
> J I
>
> With the common part finding code with diff, you will be able to
> pass blames for lines A B C D E F G I J to your parent. You are
> truly guilty for introducing "... call foo();". The problem
> here is that in addition, you will be blamed for the lines that
> implement "static foo() { ... }" at the beginning of your file.
You can use the pickaxe on its source itself, like this:
git pickaxe -n master..pu builtin-pickaxe.c
If you compare this with output from:
git log --pretty=short -p master..pu builtin-pickaxe.c
you will notice the line-movement detection in action.
During the course of development, I had to move quite a few
static functions around so that they are defined before their
first call site. This is partly because I am very bad at
initial planning (who is?) and this still being in experimental
stage I did not bother declaring static functions upfront as
forward declarations.
For example, commit db3f0f2 introduces find_last_in_target()
function, but it was moved up by commit b5c0e4f (near the tip of
"pu"). pickaxe blames the implementation of it to db3f0f20, and
also notices that the bulk of its logic was actually copied from
the implementation of pass_blame_to_parent() function in commit
b14dc9ef (the initial commit that introduced builtin-pickaxe.c).
What _ought_ to come next is to detect line movement across
files, but I'll go to bed for now.
next prev parent reply other threads:[~2006-10-14 10:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 1:43 On blame/pickaxe Junio C Hamano
2006-10-13 7:54 ` Junio C Hamano
2006-10-14 10:26 ` Junio C Hamano [this message]
2006-10-14 23:43 ` Junio C Hamano
2006-10-16 2:21 ` Petr Baudis
2006-10-16 6:43 ` Junio C Hamano
2006-10-16 14:02 ` Josef Weidendorfer
2006-10-16 14:15 ` Andy Whitcroft
2006-10-17 0:44 ` Petr Baudis
2006-10-21 3:20 ` Junio C Hamano
2006-10-16 23:45 ` Luben Tuikov
2006-10-17 9:03 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vwt739org.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.