git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Jakub Narebski
Message 4 of 4 in “Remove bashism from t3210-pack-refs.sh”
  1. Remove bashism from t3210-pack-refs.shDennis Stosberg, Oct 6, 2006
  2. Alex RiesenOct 6, 2006
  3. Jakub NarebskiOct 6, 2006
  4. Linus TorvaldsOct 6, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.