Subject: Re: [PATCH] A few more options for git-cat-file

From: "H. Peter Anvin" <[email-masked]>
Date: Sat, 03 Dec 2005 22:22:51 -0800

Junio C Hamano wrote:
> "H. Peter Anvin" <[email-masked]> writes:
> 
> 
>>This adds the following options to git-cat-file:
>>
>>-n, to get the canonical name of a resource.  This is for one thing 
>>useful in tagging scripts.
> 
> Isn't "git-rev-parse --verify" good enough?
> 

Ah, yes.  Except for the fact that I couldn't find it when I looked for 
a command that did that.  git-rev-parse seems like an eclectic mixture 
of stuff, and the name isn't very clear as to what it does.

> 
>>-e, to test for the existence of a file.
> 
> This might be useful and cleaner than "cat-file -s >/dev/null"
> but marginally so.  While reading the whole file and discarding
> that to /dev/null is wasteful and would go against tastes of
> many people, -t and -s flags do not need to read the whole thing
> and not so expensive.

Still, -e as implemented here is definitely cheaper.

	-hpa