Re: [PATCH] Remove bashism from t3210-pack-refs.sh
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Oct 6, 2006, 16:33 UTC
- Message-ID
- <Pine.LNX.4.64.0610060931160.3952@g5.osdl.org>
- In-Reply-To
- <eg5r9k$58c$1@sea.gmane.org>
On Fri, 6 Oct 2006, Jakub Narebski wrote:
Show 9 quoted lines
> Alex Riesen wrote: > > > On 10/6/06, Dennis Stosberg <dennis@stosberg.net> wrote: > >> - SHA1=$(< .git/refs/heads/a) && > >> + SHA1=`cat .git/refs/heads/a` && > > > > Only "<" (the redirection part) is bashism. The "$()" is POSIX. > > BTW. it is not packed-refs safe.
Well, since that seems to be a test-case for the packed-refs thing, that's probably not a problem ;)
In a real-life git script you should do something like
SHA1=$(git-rev-parse --verify "refs/heads/$head^0") && ...
to get the SHA1 and verify that it's all good, but since that script is all about checking that packing does the right thing, I think it's fine to do it by hand there..
Linus