From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5F804A0543; Tue, 25 Oct 2022 10:39:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42A8940A89; Tue, 25 Oct 2022 10:39:56 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 7923F400D5 for ; Tue, 25 Oct 2022 10:39:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666687193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RuvQIcYwlAGYDZipSzjUImjFZkr4/NTK1sMIxxH7PbQ=; b=aO2ISTHj/C0CIA+QuXY45KZ5GoINu3Zf7Y6Trhk5+3xnChSb2PsWuQVwRIwIyART75ApSb NluF80Dmcdxvsi81tTZEIdzyivDyNG4NLL75xvtfiSX+wwdgtpl+E+bUV5tao31bSIQj/k i+/Z+0aRYK0YWc3pwRECu6/cfs0mpz8= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-154-_7D4ZFucNsuGf94645fNQw-1; Tue, 25 Oct 2022 04:39:52 -0400 X-MC-Unique: _7D4ZFucNsuGf94645fNQw-1 Received: by mail-pl1-f199.google.com with SMTP id c10-20020a170902d48a00b001825736b382so7965045plg.15 for ; Tue, 25 Oct 2022 01:39:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RuvQIcYwlAGYDZipSzjUImjFZkr4/NTK1sMIxxH7PbQ=; b=edoUX13iz7IYYJNFs9gIR7f4LEUzvpRyqHW7Ca+iAvTXQKEfAuCJOVwcMiOjMk3Y6U JACb+TIiFZNey8J6jMI1zs3IZKozHMDQF46gOV/veHo53EspFsqORXLTL32JZMjl3a3+ SemFzzo9Zr3mrkYAALGhiVVY3nsH80Isi87vLwFboD/zxjAf54iGwFxH/+jcorvHodP0 VNDNgeszYmToaPGuh/rGTGKVVwDa+c27W+UaUHxLHun5LtuHeuKucq3yeg+i+M8fZn4T MNE779fgc8f93lwU1YJmBU7q4pcf08rhYQqOf4k6+HT+Xqyih9BqRMLYxM7e9+E0fXe0 Rhzw== X-Gm-Message-State: ACrzQf2DjdHY6A081vDuh64VhDJbkHA4wiOTThPdxX+C+ieq1tXfcRqX L0PF5Zpdh5QWM21yuCmFqyt6sYKLbSZLpUQqXsjHWkJdOTGTfXwrDlGdcwncVMjp27VN6+7TwvJ VUpmuVIY3oR0Hqbz4+gA= X-Received: by 2002:a17:90a:428e:b0:205:d5fe:e0b3 with SMTP id p14-20020a17090a428e00b00205d5fee0b3mr42867484pjg.33.1666687191606; Tue, 25 Oct 2022 01:39:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62Vmrq7FVSFPs2y39czKkSNbA0xObFW3kQDvzF87kgpZVuvCwkhneK5pYeQH+yfrW7ZC5rZYqVWN65L7qHm1k= X-Received: by 2002:a17:90a:428e:b0:205:d5fe:e0b3 with SMTP id p14-20020a17090a428e00b00205d5fee0b3mr42867466pjg.33.1666687191285; Tue, 25 Oct 2022 01:39:51 -0700 (PDT) MIME-Version: 1.0 References: <20221024153706.3117107-1-alialnu@nvidia.com> In-Reply-To: <20221024153706.3117107-1-alialnu@nvidia.com> From: David Marchand Date: Tue, 25 Oct 2022 10:39:40 +0200 Message-ID: Subject: Re: [PATCH] devtools: check for supported git version To: Ali Alnubani Cc: dev@dpdk.org, Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Oct 24, 2022 at 5:38 PM Ali Alnubani wrote: > > 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 [] [-e] [...] [[--] ...] > [..] > > [1] https://github.com/git/git/blob/v2.19.0/Documentation/RelNotes/2.19.0.txt > > Signed-off-by: Ali Alnubani > Signed-off-by: Thomas Monjalon > --- > 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 Would it work with $0, to refer to the script itself? > + echo "git version >= 2.19 is required" >&2 > + exit 1 > +fi > + > # sorting order > export LC_COLLATE=C > > -- > 2.25.1 > -- David Marchand