Fix: extra-version-git.sh redirect stderr to /dev/null
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 15 Mar 2019 15:13:39 +0000 (11:13 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 15 Mar 2019 15:17:48 +0000 (11:17 -0400)
Running make in a git repo that does not contain any tag prints:

fatal: No names found, cannot describe anything.

in the make and make clean outputs.

It's fine to have no tag name available (extra-version-git.sh will
return the value 0), but we should not print an error in the make
output. Redirect this error to /dev/null.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Michael Jeanson <mjeanson@efficios.com>
extra-version-git.sh

index e5a3e176699d59d956d550318ff0bf97adfa27d6..0f1a985771495224e8ab30d41a3847467dab534d 100755 (executable)
@@ -7,7 +7,7 @@ TOP_LTTNG_MODULES_DIR="$1"
 GIT_VERSION="0"
 
 if test -x "$(which git 2>&1;true)" && test -r "${TOP_LTTNG_MODULES_DIR}/.git"; then
-       GIT_VERSION_STR="$(cd "${TOP_LTTNG_MODULES_DIR}" && git describe --tags --dirty)"
+       GIT_VERSION_STR="$(cd "${TOP_LTTNG_MODULES_DIR}" && git describe --tags --dirty 2> /dev/null)"
        GIT_CURRENT_TAG="$(cd "${TOP_LTTNG_MODULES_DIR}" && git describe --tags --exact-match --match="v[0-9]*" HEAD 2> /dev/null)"
 
        GIT_VERSION="${GIT_VERSION_STR}"
This page took 0.026568 seconds and 4 git commands to generate.