Re: [PATCH 2/3] cvsimport: use show-ref to support packed refs
- From
Jeff King <peff@peff.net>
- Date
- Nov 28, 2007, 22:52 UTC
- Message-ID
- <20071128225229.GA13836@coredump.intra.peff.net>
- In-Reply-To
- <20071128224313.GB13298@coredump.intra.peff.net>
On Wed, Nov 28, 2007 at 05:43:13PM -0500, Jeff King wrote:
Show 10 quoted lines
> > sub get_headref {
> > my ($it) = (@_);
> > my $r = `git-rev-parse --verify "refs/$it"`;
> > return undef unless $? == 0;
> > chomp $r;
> > return $r;
> > }
>
> I have no comment on which is the best command to use (you would know
> much better than I), but adding "refs/" is wrong.BTW, one bad thing about the new get_headref compared to the original is that it does not distinguish very well between "ref does not exist" and "an error occurred." Is there a lookup command that makes such a distinction possible?
-Peff