From 5716babbec6eadfa12ad728c5ed7b3e07c664375 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 15 Mar 2019 11:13:39 -0400 Subject: [PATCH] Fix: extra-version-git.sh redirect stderr to /dev/null 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 Suggested-by: Michael Jeanson --- scripts/extra-version-git.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/extra-version-git.sh b/scripts/extra-version-git.sh index e5a3e176..0f1a9857 100755 --- a/scripts/extra-version-git.sh +++ b/scripts/extra-version-git.sh @@ -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}" -- 2.34.1