DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] devtools: check for supported git version
@ 2022-10-24 15:37 Ali Alnubani
  2022-10-25  8:39 ` David Marchand
  2022-10-25 10:15 ` [PATCH v2] " Ali Alnubani
  0 siblings, 2 replies; 7+ messages in thread
From: Ali Alnubani @ 2022-10-24 15:37 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon

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>
---
 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..9c322249da 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 -- devtools/parse-flow-support.sh >/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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-31 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 15:37 [PATCH] devtools: check for supported git version Ali Alnubani
2022-10-25  8:39 ` David Marchand
2022-10-25 10:15 ` [PATCH v2] " Ali Alnubani
2022-10-26  6:24   ` David Marchand
2022-10-26  7:52     ` Ferruh Yigit
2022-10-26  8:34       ` Chaoyong He
2022-10-31 15:46         ` Thomas Monjalon

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).