From: Thomas Monjalon Date: Mon, 29 Aug 2016 08:15:47 +0000 (+0200) Subject: scripts: hide double git reference check error X-Git-Tag: spdx-start~6004 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ba5dfa7f021a899b48c5d3e95095dcb241401dc6;p=dpdk.git scripts: hide double git reference check error When checking a git reference which does not exist, a git error with the long git-branch usage is printed: % scripts/check-git-log.sh '-1 3780cbd' error: malformed object name 2de9f8551ff9 usage: git branch ... [a lot of lines] Wrong 'Fixes' reference: Fixes: 2de9f8551ff9 ("ethdev: fix documentation for queue start/stop") The error from the script is sufficient so the git error can be hidden. Signed-off-by: Thomas Monjalon --- diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index e416aea15a..6137098baa 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -180,7 +180,7 @@ IFS=' fixtags=$(echo "$tags" | grep '^Fixes: ') bad=$(for fixtag in $fixtags ; do hash=$(echo "$fixtag" | sed 's,^Fixes: \([0-9a-f]*\).*,\1,') - if git branch --contains $hash | grep -q '^\*' ; then + if git branch --contains $hash 2>&- | grep -q '^\*' ; then good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-) else good="reference not in current branch"