Re: blameview and file contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aneesh Kumar <aneesh.kumar@xxxxxxxxx> 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.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]