From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-pickaxe: blame rewritten.
Date: Fri, 13 Oct 2006 13:31:35 -0700 [thread overview]
Message-ID: <7vd58wc5zs.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7viripnyfh.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 12 Oct 2006 12:09:38 -0700")
Junio C Hamano <junkio@cox.net> writes:
>> (I'd actually also like to have a range-modifier, so that I could do
>>
>> git annotate --since=2.weeks.ago v2.6.18.. <path>
>>
>> that didn't go back beyond a certain point,...
>
> I am not sure about revision bottom (v.2.6.18..) offhand, but
> the age limit (--since=2.weeks) should be trivial.
>
> Inside pass_blame() while we iterate over the parents of the
> suspect we are looking at, you can skip the parent if it is
> older than the age limit, or an ancestor of revision bottom,
> like this:
>
> --- l/builtin-pickaxe.c
> +++ k/builtin-pickaxe.c
> @@ -450,6 +450,12 @@ static void pass_blame(struct scoreboard
> parent = parent->next, parent_ix++) {
> if (parse_commit(parent->item))
> continue;
> +
> + if (parent is older than age limit)
> + continue;
> + if (parent is an ancestor of revision bottom)
> + continue;
> +
> porigin = find_origin(sb, parent->item, origin->path);
> if (!porigin)
> porigin = find_rename(sb, parent->item, origin);
>
This is not quite right. The above code tries to avoid passing
blames to the boundary revisions, so "v2.6.18.." makes every old
line to be blamed on one revision after v2.6.18, which might be
technically correct but not what we want.
Instead, we should pass blame, and then prevent boundary
revisions to pass blame further down. The code in "pu" today
has seen slight restructure of this part and this change should
be easier to implement there, something along the lines of...
--- l/builtin-pickaxe.c
+++ k/builtin-pickaxe.c
@@ -450,8 +450,7 @@ static int pass_blame_to_parent(struct s
}
#define MAXPARENT 16
-static void pass_blame(struct scoreboard *sb, struct origin *origin,
- struct rev_info *revs)
+static void pass_blame(struct scoreboard *sb, struct origin *origin)
{
int i, parent_ix;
struct commit *commit = origin->commit;
@@ -469,10 +468,6 @@ static void pass_blame(struct scoreboard
if (parse_commit(p))
continue;
- if (p->object.flags & UNINTERESTING)
- continue;
- if (revs->max_age != -1 && p->date < revs->max_age)
- continue;
porigin = find_origin(sb, parent->item, origin->path);
if (!porigin)
@@ -516,6 +511,7 @@ static void assign_blame(struct scoreboa
while (1) {
int i;
struct origin *suspect = NULL;
+ struct commit *commit;
/* find one suspect to break down */
for (i = 0; !suspect && i < sb->num_entries; i++) {
@@ -525,7 +521,10 @@ static void assign_blame(struct scoreboa
if (!suspect)
return; /* all done */
- pass_blame(sb, suspect, revs);
+ commit = suspect->commit;
+ if (!(commit->object.flags & UNINTERESTING) &&
+ !(revs->max_age != -1 && commit->date < revs->max_age))
+ pass_blame(sb, suspect, revs);
/* Take responsibility for the remaining entries */
for (i = 0; i < sb->num_entries; i++)
next prev parent reply other threads:[~2006-10-13 20:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 8:52 [PATCH] git-pickaxe: blame rewritten Junio C Hamano
2006-10-12 15:58 ` Linus Torvalds
2006-10-12 19:09 ` Junio C Hamano
2006-10-12 20:10 ` Luben Tuikov
2006-10-13 20:31 ` Junio C Hamano [this message]
2006-10-13 5:35 ` Junio C Hamano
2006-10-12 19:31 ` Luben Tuikov
2006-10-12 22:20 ` Junio C Hamano
2006-10-13 20:54 ` Luben Tuikov
2006-10-13 21:38 ` Junio C Hamano
2006-10-13 21:59 ` Luben Tuikov
2006-10-13 22:50 ` Junio C Hamano
2006-10-13 0:06 ` Junio C Hamano
2006-10-13 1:04 ` Luben Tuikov
2006-10-13 1:45 ` Junio C Hamano
2006-10-12 21:55 ` Jakub Narebski
2006-10-12 22:47 ` Petr Baudis
2006-10-12 23:35 ` 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=7vd58wc5zs.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).