From: Linus Torvalds Date: Fri, 06 Oct 2006 16:33:59 GMT Subject: Re: [PATCH] Remove bashism from t3210-pack-refs.sh Message-ID: In-Reply-To: On Fri, 6 Oct 2006, Jakub Narebski wrote: > Alex Riesen wrote: > > > On 10/6/06, Dennis Stosberg 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