Re: blameview and file contents
- From
Aneesh Kumar <aneesh.kumar@gmail.com>
- Date
- Jan 30, 2007, 07:22 UTC
- Message-ID
- <cc723f590701292322q7365f99bg3b7c76834f6fbad8@mail.gmail.com>
- In-Reply-To
- <20070130065417.GA32640@spearce.org>
On 1/30/07, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 19 quoted lines
> 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")
>
> ?
>See i said that there should be a simple way. Can we get this documented in git-cat-file man page
-aneesh