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

5c7d3c95 broke 026351a

From
Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
Date
Jan 26, 2006, 13:45 UTC
Message-ID
<20060126134521.GA11570@informatik.uni-freiburg.de>
Hello,

zeisberger@io:~$ VN=$(nonexistentcmd) || echo lala bash: nonexistentcmd: command not found lala

uzeisberger@io:~$ VN=$(nonexistentcmd | sed 's/-/./g') || echo lala bash: nonexistentcmd: command not found

The reason is (from bash(1)):
	The return status of a pipeline is the exit status of the last
	command, unless the pipefail option is enabled.
and the sed command is fine.
pipefail is not portable, i.e. Solaris' sh doesn't support it.
I'd suggest:
	if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then
		VN=$(echo "$VN" | sed 's/-/./g');
	else
		VN=$(cat version) || VN="$DEF_VER";
	fi
This works with Solaris' sh and bash.

Best regards Uwe

-- 
Uwe Zeisberger

exit vi, lesson V:
o : q ! CTRL-V <CR> <Esc> " d d d @ d
Next: Uwe Zeisberger
Message 1 of 2 in “5c7d3c95 broke 026351a”
  1. Uwe ZeisbergerJan 26, 2006
  2. Make GIT-VERSION-GEN tolerate missing git describe command againUwe Zeisberger, Jan 26, 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.