Re: fatal: ambiguous message
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 2, 2011, 18:34 UTC
- Message-ID
- <20110102183453.GA13463@burratino>
- In-Reply-To
- <4D20BE0B.6040104@gmail.com>
Hi,
Context: http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob;f=build-aux/git-version-gen
Bruce Korb wrote:
> So, this message says, "fatal: ..." > and comes from git and all three "git" invocations redirect stderr to > /dev/null. The fact that we see it is a git bug. Error messages > should be directed to stderr and thus written to /dev/null.
Were you been able to reproduce that outside the script?
> So, git-version-gen is correct to continue, but git should fail
> with a message that names the program that fails ("git") and
> should direct the message to stderr.No thoughts on this part. git has at least four kinds of message it sends to stderr (fatal:, warning:, error:, and usage:) but I am not sure it is useful to distinguish them ---
git add: pathspec 'nonsense' did not match any files
might be nicer.
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen index 5617eb8..119d7aa 100755 --- a/build-aux/git-version-gen +++ b/build-aux/git-version-gen @@ -119,7 +119,7 @@ then # result is the same as if we were using the newer version # of git describe. vtag=`echo "$v" | sed 's/-.*//'` - numcommits=`git rev-list "$vtag"..HEAD | wc -l` + numcommits=`git rev-list "$vtag"..HEAD 2>/dev/null | wc -l` v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; ;; esac