On Wed, 9 Mar 2022 at 14:01, Mikael Morin <morin-mik...@orange.fr> wrote: > > Hello, > > Le 08/03/2022 à 18:58, Jonathan Wakely via Gcc-patches a écrit : > > Replace \([0-9]\+\) with \([0-9][0-9]*\) or with \([1-9][0-9]*\) in release > > branch numbers, where > > a leading zero does not occur. > > > Note that you also changed some gcc-[0-9]* to gcc-[1-9]*, which is a > typo/thinko I guess? It looks like it wouldn’t match gcc-10 any more > for example…
Those are all in the --match argument, which is a shell glob not a regex. See the git-describe(1) man page: --match <pattern> Only consider tags matching the given glob(7) pattern > > > diff --git a/contrib/git-descr.sh b/contrib/git-descr.sh > > index ba5d711f330..95363279d8c 100755 > > --- a/contrib/git-descr.sh > > +++ b/contrib/git-descr.sh > > @@ -18,11 +18,11 @@ do > > done > > > > if test x$short = xyes; then > > - r=$(git describe --all --match 'basepoints/gcc-[0-9]*' $c | sed -n > > 's,^\(tags/\)\?basepoints/gcc-\([0-9]\+\)-\([0-9]\+\)-g[0-9a-f]*$,r\2-\3,p;s,^\(tags/\)\?basepoints/gcc-\([0-9]\+\)$,r\2-0,p'); > > + r=$(git describe --all --match 'basepoints/gcc-[1-9]*' $c | sed -n > > 's,^tags/,,;s,^basepoints/gcc-\([1-9][0-9]*\)-\([0-9][0-9]*\)-g[0-9a-f]*$,r\1-\2,p;s,^basepoints/gcc-\([1-9][0-9]*\)$,r\1-0,p'); > > …here… > > > elif test x$long = xyes; then > > - r=$(git describe --all --abbrev=40 --match 'basepoints/gcc-[0-9]*' $c > > | sed -n 's,^\(tags/\)\?basepoints/gcc-,r,p') > > + r=$(git describe --all --abbrev=40 --match 'basepoints/gcc-[1-9]*' $c > > | sed -n 's,^tags/,,;s,^basepoints/gcc-,r,p') > > … and here … > > > else > > - r=$(git describe --all --abbrev=14 --match 'basepoints/gcc-[0-9]*' $c > > | sed -n 's,^\(tags/\)\?basepoints/gcc-,r,p'); > > + r=$(git describe --all --abbrev=14 --match 'basepoints/gcc-[1-9]*' $c > > | sed -n 's,^tags/,,;s,^basepoints/gcc-,r,p') > > … and here. >