DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ali Alnubani <alialnu@nvidia.com>
To: <dev@dpdk.org>
Cc: <david.marchand@redhat.com>, Thomas Monjalon <thomas@monjalon.net>
Subject: [PATCH v2] devtools: check for supported git version
Date: Tue, 25 Oct 2022 13:15:12 +0300	[thread overview]
Message-ID: <20221025101512.3190439-1-alialnu@nvidia.com> (raw)
In-Reply-To: <20221024153706.3117107-1-alialnu@nvidia.com>

The script devtools/parse-flow-support.sh uses the git-grep
option (-o, --only-matching), which is only supported from
git version 2.19 and onwards.[1]

The script now exits early providing a clear message to the user
about the required git version instead of showing the following
error messages multiple times:
  error: unknown switch `o'
  usage: git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]
  [..]

[1] https://github.com/git/git/blob/v2.19.0/Documentation/RelNotes/2.19.0.txt

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
Changes in v2:
- Refer to filename by $0 (Suggested by David Marchand).

 devtools/parse-flow-support.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/devtools/parse-flow-support.sh b/devtools/parse-flow-support.sh
index 63c0b20e23..9811c7881c 100755
--- a/devtools/parse-flow-support.sh
+++ b/devtools/parse-flow-support.sh
@@ -13,6 +13,12 @@ if [ -z "$dir" ]; then
 	exit 1
 fi
 
+# test git-grep for -o (--only-matching) option
+if ! git grep -qo git -- $0 >/dev/null 2>&1; then
+	echo "git version >= 2.19 is required" >&2
+	exit 1
+fi
+
 # sorting order
 export LC_COLLATE=C
 
-- 
2.25.1


  parent reply	other threads:[~2022-10-25 10:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 15:37 [PATCH] " Ali Alnubani
2022-10-25  8:39 ` David Marchand
2022-10-25 10:15 ` Ali Alnubani [this message]
2022-10-26  6:24   ` [PATCH v2] " David Marchand
2022-10-26  7:52     ` Ferruh Yigit
2022-10-26  8:34       ` Chaoyong He
2022-10-31 15:46         ` 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=20221025101512.3190439-1-alialnu@nvidia.com \
    --to=alialnu@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).