[PATCH v2] devtools: check for supported git version

Thomas Monjalon thomas at monjalon.net
Mon Oct 31 16:46:34 CET 2022


26/10/2022 10:34, Chaoyong He:
> > On 10/26/2022 7:24 AM, David Marchand wrote:
> > > On Tue, Oct 25, 2022 at 12:15 PM Ali Alnubani <alialnu at nvidia.com> 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 [<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 at nvidia.com>
> > >> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > >
> > > I don't have a "non working" git, but the patch lgtm.
> > >
> > > Acked-by: David Marchand <david.marchand at redhat.com>
> > >
> > 
> > +Chaoyong,
> > 
> > He had observed the problem, perhaps he can help to test.
> 
> I test in my host, it does work.
> 
> $ git --version
> git version 2.18.5
> 
> Before this patch:
> $ ./devtools/check-doc-vs-code.sh
> error: unknown switch `o'
> usage: git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]
>     --cached              search in index instead of in the work tree
>     ...
> repeat many times.
> 
> After this patch:
> $ ./devtools/check-doc-vs-code.sh
> git version >= 2.19 is required

Applied, thanks.






More information about the dev mailing list