DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] scripts: hide double git reference check error
Date: Mon, 29 Aug 2016 10:35:35 +0200	[thread overview]
Message-ID: <1472459735-11683-1-git-send-email-thomas.monjalon@6wind.com> (raw)

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 <thomas.monjalon@6wind.com>
---
 scripts/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh
index e416aea..6137098 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"
-- 
2.7.0

             reply	other threads:[~2016-08-29  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29  8:35 Thomas Monjalon [this message]
2016-09-13 14:45 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472459735-11683-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).