git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
To: git@vger.kernel.org
Subject: 5c7d3c95 broke 026351a
Date: Thu, 26 Jan 2006 14:45:22 +0100	[thread overview]
Message-ID: <20060126134521.GA11570@informatik.uni-freiburg.de> (raw)

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

             reply	other threads:[~2006-01-26 13:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26 13:45 Uwe Zeisberger [this message]
2006-01-26 16:39 ` [PATCH] Make GIT-VERSION-GEN tolerate missing git describe command again Uwe Zeisberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060126134521.GA11570@informatik.uni-freiburg.de \
    --to=zeisberg@informatik.uni-freiburg.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).