From: Ryan Anderson <ryan@michonline.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add git-annotate - a tool for annotating files with the revision and person that created each line in the file.
Date: Fri, 10 Feb 2006 17:04:45 -0500 [thread overview]
Message-ID: <20060210220445.GD456@mythryan2.michonline.com> (raw)
In-Reply-To: <7vlkwlo788.fsf@assigned-by-dhcp.cox.net>
On Wed, Feb 08, 2006 at 01:45:11PM -0800, Junio C Hamano wrote:
> Ryan Anderson <ryan@michonline.com> writes:
>
> >> It's been a while since I looked at it the last time so it may
> >> not even work with the current git, but here it is..
> >
> > I'll take a look through this in greater detail later, hopefully your
> > approach can be applied. Diff-analyzing is apparently tricky.
>
> Reading diff is tricky but I was lazy to match up the lines by
> hand, which is also a real work ;-).
Reading a diff is tricky, yes, but if you're willing to just throw RAM
at the problem, it might not be quite as bad as I was trying at first.
My current thought on how to get it more correct is this:
foreach $rev (@revqueue) {
foreach $parent (@{$revs{$rev}{parents}}) {
my @templines = @{$revs{$rev}{lines}};
$revs{$parent}{lines} = apply_diff(\@templlines);
}
}
The @lines arrays that get built will be entirely made up of hash or
array references, so they just get reused for each successive file.
When apply_diff() deletes a line from the new copy, it should mark that
line as "claimed" by the current rev.
I'm thinking that each element of @lines will look like this:
{
text => $text,
in_original => [0 | 1],
claimed_by => $rev,
}
at least to start.
This method can sanity check itself by calling git cat-file and actually
reading in each version of the file, and comparing it against the
generated copy, aborting if we get the two out of sync.
I'll see about implementing something along these lines this weekend,
time permitting.
--
Ryan Anderson
sometimes Pug Majere
prev parent reply other threads:[~2006-02-11 9:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-08 14:52 [PATCH] Add git-annotate - a tool for annotating files with the revision and person that created each line in the file Ryan Anderson
2006-02-08 15:09 ` Peter Eriksen
2006-02-08 16:05 ` Johannes Schindelin
2006-02-08 16:35 ` Franck Bui-Huu
2006-02-08 17:45 ` Johannes Schindelin
2006-02-08 19:19 ` Junio C Hamano
2006-02-10 11:25 ` Ralf Baechle
2006-02-10 11:55 ` Andreas Ericsson
2006-02-14 10:51 ` Fredrik Kuivinen
2006-02-08 18:47 ` Randal L. Schwartz
2006-02-09 9:19 ` Andreas Ericsson
2006-02-09 9:57 ` Junio C Hamano
2006-02-09 12:04 ` Franck Bui-Huu
2006-02-09 12:47 ` Andreas Ericsson
2006-02-08 19:09 ` Linus Torvalds
2006-02-08 19:51 ` Junio C Hamano
2006-02-08 21:07 ` Ryan Anderson
2006-02-08 21:45 ` Junio C Hamano
2006-02-10 22:04 ` Ryan Anderson [this message]
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=20060210220445.GD456@mythryan2.michonline.com \
--to=ryan@michonline.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).