From: "Shawn O. Pearce" <spearce@spearce.org>
To: Aneesh Kumar <aneesh.kumar@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: blameview and file contents
Date: Tue, 30 Jan 2007 01:54:17 -0500 [thread overview]
Message-ID: <20070130065417.GA32640@spearce.org> (raw)
In-Reply-To: <cc723f590701292246v282408d0o27a0d8320c027743@mail.gmail.com>
Aneesh Kumar <aneesh.kumar@gmail.com> wrote:
> I guess blame view need to pull the file content from the repository
> rather than opening it directly. If i have a working copy that is not
> yet committed it gives wrong results. I tried some changes as below.
> But i guess there should be a much easier way.
> -open(my $fh, '<', $fn)
> - or die "unable to open $fn: $!";
> +$fh = get_file_handle("HEAD", $fn);
> while(<$fh>) {
> chomp;
> $fileview->{data}->[$.] = ['HEAD', '?', "$fn:$.", $_];
Doesn't the following work just as well, and use a lot less code?
open(my $fh, '|-', 'git', 'cat-file', 'blob', "HEAD:$fn")
?
--
Shawn.
next prev parent reply other threads:[~2007-01-30 6:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-30 6:46 blameview and file contents Aneesh Kumar
2007-01-30 6:54 ` Shawn O. Pearce [this message]
2007-01-30 7:22 ` Aneesh Kumar
2007-01-30 7:29 ` Shawn O. Pearce
2007-01-30 8:30 ` 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=20070130065417.GA32640@spearce.org \
--to=spearce@spearce.org \
--cc=aneesh.kumar@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox