autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fatal: ambiguous message


From: Jonathan Nieder
Subject: Re: fatal: ambiguous message
Date: Sun, 2 Jan 2011 12:34:53 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]