public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/]
@ 2022-03-08 17:58 Jonathan Wakely
  2022-03-08 18:04 ` Jakub Jelinek
  2022-03-09 13:54 ` Mikael Morin
  0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Wakely @ 2022-03-08 17:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: marxin

This now works with Solaris /usr/xpg4/bin/sed and should work with BSD
sed too.

OK for trunk?

-- >8 --

POSIX sed does not support \? or \+ in its Basic Regular Expression
grammar. Replace the \(tags/\)\? part of the pattern with a substitution
to remove ^tags/ before other substitutions. 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.

contrib/ChangeLog:

	PR other/102664
	* git-descr.sh: Use portable sed commands.
	* git-undescr.sh: Likewise.
---
 contrib/git-descr.sh   | 6 +++---
 contrib/git-undescr.sh | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

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');
 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')
 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')
     expr ${r:-no} : 'r[0-9]\+$' >/dev/null && r=${r}-0-g$(git rev-parse $c);
 fi;
 if test -n $r; then
diff --git a/contrib/git-undescr.sh b/contrib/git-undescr.sh
index 9d882a6814e..fd694077467 100755
--- a/contrib/git-undescr.sh
+++ b/contrib/git-undescr.sh
@@ -3,11 +3,11 @@
 # Script to undescribe a GCC revision
 
 o=$(git config --get gcc-config.upstream);
-r=$(echo $1 | sed -n 's,^r\([0-9]\+\)-[0-9]\+\(-g[0-9a-f]\+\)\?$,\1,p');
-n=$(echo $1 | sed -n 's,^r[0-9]\+-\([0-9]\+\)\(-g[0-9a-f]\+\)\?$,\1,p');
+r=$(echo $1 | sed -n 's,^r\([1-9][0-9]*\)-[0-9][0-9]*\(-g[0-9a-f]*\)*$,\1,p');
+n=$(echo $1 | sed -n 's,^r[1-9][0-9]*-\([0-9][0-9]*\)\(-g[0-9a-f]*\)*$,\1,p');
 
 test -z $r && echo Invalid id $1 && exit 1;
 h=$(git rev-parse --verify --quiet ${o:-origin}/releases/gcc-$r);
 test -z $h && h=$(git rev-parse --verify --quiet ${o:-origin}/master);
-p=$(git describe --all --match 'basepoints/gcc-'$r $h | sed -n 's,^\(tags/\)\?basepoints/gcc-[0-9]\+-\([0-9]\+\)-g[0-9a-f]*$,\2,p;s,^\(tags/\)\?basepoints/gcc-[0-9]\+$,0,p');
+p=$(git describe --all --match 'basepoints/gcc-'$r $h | sed -n 's,^tags/,,;s,^basepoints/gcc-[1-9][0-9]*-\([0-9][0-9]*\)-g[0-9a-f]*$,\1,p;s,^basepoints/gcc-[1-9][0-9]*$,0,p');
 git rev-parse --verify $h~$(expr $p - $n);
-- 
2.34.1


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

* Re: [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/]
  2022-03-08 17:58 [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/] Jonathan Wakely
@ 2022-03-08 18:04 ` Jakub Jelinek
  2022-03-09 13:54 ` Mikael Morin
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Jelinek @ 2022-03-08 18:04 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, marxin

On Tue, Mar 08, 2022 at 05:58:34PM +0000, Jonathan Wakely via Gcc-patches wrote:
> This now works with Solaris /usr/xpg4/bin/sed and should work with BSD
> sed too.
> 
> OK for trunk?
> 
> -- >8 --
> 
> POSIX sed does not support \? or \+ in its Basic Regular Expression
> grammar. Replace the \(tags/\)\? part of the pattern with a substitution
> to remove ^tags/ before other substitutions. 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.
> 
> contrib/ChangeLog:
> 
> 	PR other/102664
> 	* git-descr.sh: Use portable sed commands.
> 	* git-undescr.sh: Likewise.

LGTM, thanks.

	Jakub


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

* Re: [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/]
  2022-03-08 17:58 [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/] Jonathan Wakely
  2022-03-08 18:04 ` Jakub Jelinek
@ 2022-03-09 13:54 ` Mikael Morin
  2022-03-09 17:06   ` Jonathan Wakely
  2022-03-09 17:40   ` Patrick Palka
  1 sibling, 2 replies; 7+ messages in thread
From: Mikael Morin @ 2022-03-09 13:54 UTC (permalink / raw)
  To: Jonathan Wakely, gcc-patches; +Cc: marxin

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…

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

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

* Re: [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/]
  2022-03-09 13:54 ` Mikael Morin
@ 2022-03-09 17:06   ` Jonathan Wakely
  2022-03-09 17:40   ` Patrick Palka
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2022-03-09 17:06 UTC (permalink / raw)
  To: Mikael Morin; +Cc: gcc Patches, marxin

On Wed, 9 Mar 2022 at 14:01, Mikael Morin <morin-mikael@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.
>


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

* Re: [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/]
  2022-03-09 13:54 ` Mikael Morin
  2022-03-09 17:06   ` Jonathan Wakely
@ 2022-03-09 17:40   ` Patrick Palka
  2022-03-09 17:56     ` [PATCH] contrib: Fix up git-descr.sh regression [PR102664] Jakub Jelinek
  2022-03-09 18:08     ` [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/] Jonathan Wakely
  1 sibling, 2 replies; 7+ messages in thread
From: Patrick Palka @ 2022-03-09 17:40 UTC (permalink / raw)
  To: Mikael Morin; +Cc: Jonathan Wakely, GCC Patches, marxin

On Wed, Mar 9, 2022 at 8:54 AM Mikael Morin <morin-mikael@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…

Perhaps related to this, I noticed the following
  git gcc-descr ea1ce0d163ea1d63b6837144ae4be51d92630007
now fails with
  fatal: No tags can describe 'ea1ce0d163ea1d63b6837144ae4be51d92630007'.
instead of outputting
  r0-52309-gea1ce0d163ea1d

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


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

* [PATCH] contrib: Fix up git-descr.sh regression [PR102664]
  2022-03-09 17:40   ` Patrick Palka
@ 2022-03-09 17:56     ` Jakub Jelinek
  2022-03-09 18:08     ` [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/] Jonathan Wakely
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Jelinek @ 2022-03-09 17:56 UTC (permalink / raw)
  To: Patrick Palka, Jonathan Wakely; +Cc: gcc-patches

On Wed, Mar 09, 2022 at 12:40:24PM -0500, Patrick Palka via Gcc-patches wrote:
> On Wed, Mar 9, 2022 at 8:54 AM Mikael Morin <morin-mikael@orange.fr> wrote:
> > 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…
> 
> Perhaps related to this, I noticed the following
>   git gcc-descr ea1ce0d163ea1d63b6837144ae4be51d92630007
> now fails with
>   fatal: No tags can describe 'ea1ce0d163ea1d63b6837144ae4be51d92630007'.
> instead of outputting
>   r0-52309-gea1ce0d163ea1d

That is because of those [0-9] to [1-9] changes which prevent
basepoints/gcc-0 from working.  While basepoints/gcc-005 etc. are certainly
unespected, basepoints/gcc-0 needs to work.

Ok for trunk?

2022-03-09  Jakub Jelinek  <jakub@redhat.com>

	PR other/102664
	* git-descr.sh: Replace all [1-9] occurrences with [0-9].
	* git-undescr.sh: Likewise.

--- contrib/git-descr.sh.jj	2022-03-09 09:09:55.392843652 +0100
+++ contrib/git-descr.sh	2022-03-09 18:49:39.426914348 +0100
@@ -18,11 +18,11 @@ do
 done
 
 if test x$short = xyes; then
-    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');
+    r=$(git describe --all --match 'basepoints/gcc-[0-9]*' $c | sed -n 's,^tags/,,;s,^basepoints/gcc-\([0-9][0-9]*\)-\([0-9][0-9]*\)-g[0-9a-f]*$,r\1-\2,p;s,^basepoints/gcc-\([0-9][0-9]*\)$,r\1-0,p');
 elif test x$long = xyes; then
-    r=$(git describe --all --abbrev=40 --match 'basepoints/gcc-[1-9]*' $c | sed -n 's,^tags/,,;s,^basepoints/gcc-,r,p')
+    r=$(git describe --all --abbrev=40 --match 'basepoints/gcc-[0-9]*' $c | sed -n 's,^tags/,,;s,^basepoints/gcc-,r,p')
 else
-    r=$(git describe --all --abbrev=14 --match 'basepoints/gcc-[1-9]*' $c | sed -n 's,^tags/,,;s,^basepoints/gcc-,r,p')
+    r=$(git describe --all --abbrev=14 --match 'basepoints/gcc-[0-9]*' $c | sed -n 's,^tags/,,;s,^basepoints/gcc-,r,p')
     expr ${r:-no} : 'r[0-9]\+$' >/dev/null && r=${r}-0-g$(git rev-parse $c);
 fi;
 if test -n $r; then
--- contrib/git-undescr.sh.jj	2022-03-09 09:09:55.392843652 +0100
+++ contrib/git-undescr.sh	2022-03-09 18:50:14.425429223 +0100
@@ -3,11 +3,11 @@
 # Script to undescribe a GCC revision
 
 o=$(git config --get gcc-config.upstream);
-r=$(echo $1 | sed -n 's,^r\([1-9][0-9]*\)-[0-9][0-9]*\(-g[0-9a-f]*\)*$,\1,p');
-n=$(echo $1 | sed -n 's,^r[1-9][0-9]*-\([0-9][0-9]*\)\(-g[0-9a-f]*\)*$,\1,p');
+r=$(echo $1 | sed -n 's,^r\([0-9][0-9]*\)-[0-9][0-9]*\(-g[0-9a-f]*\)*$,\1,p');
+n=$(echo $1 | sed -n 's,^r[0-9][0-9]*-\([0-9][0-9]*\)\(-g[0-9a-f]*\)*$,\1,p');
 
 test -z $r && echo Invalid id $1 && exit 1;
 h=$(git rev-parse --verify --quiet ${o:-origin}/releases/gcc-$r);
 test -z $h && h=$(git rev-parse --verify --quiet ${o:-origin}/master);
-p=$(git describe --all --match 'basepoints/gcc-'$r $h | sed -n 's,^tags/,,;s,^basepoints/gcc-[1-9][0-9]*-\([0-9][0-9]*\)-g[0-9a-f]*$,\1,p;s,^basepoints/gcc-[1-9][0-9]*$,0,p');
+p=$(git describe --all --match 'basepoints/gcc-'$r $h | sed -n 's,^tags/,,;s,^basepoints/gcc-[0-9][0-9]*-\([0-9][0-9]*\)-g[0-9a-f]*$,\1,p;s,^basepoints/gcc-[0-9][0-9]*$,0,p');
 git rev-parse --verify $h~$(expr $p - $n);


	Jakub


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

* Re: [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/]
  2022-03-09 17:40   ` Patrick Palka
  2022-03-09 17:56     ` [PATCH] contrib: Fix up git-descr.sh regression [PR102664] Jakub Jelinek
@ 2022-03-09 18:08     ` Jonathan Wakely
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2022-03-09 18:08 UTC (permalink / raw)
  To: Patrick Palka; +Cc: Mikael Morin, GCC Patches, marxin

On Wed, 9 Mar 2022 at 17:40, Patrick Palka <ppalka@redhat.com> wrote:
>
> On Wed, Mar 9, 2022 at 8:54 AM Mikael Morin <morin-mikael@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…
>
> Perhaps related to this, I noticed the following
>   git gcc-descr ea1ce0d163ea1d63b6837144ae4be51d92630007
> now fails with
>   fatal: No tags can describe 'ea1ce0d163ea1d63b6837144ae4be51d92630007'.
> instead of outputting
>   r0-52309-gea1ce0d163ea1d

Ah yes, now that one is a bug. Changing it to [1-9]* was intentional,
and does still match gcc-10, but I forgot we have "r0" for really old
commits.




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


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

end of thread, other threads:[~2022-03-09 18:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 17:58 [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/] Jonathan Wakely
2022-03-08 18:04 ` Jakub Jelinek
2022-03-09 13:54 ` Mikael Morin
2022-03-09 17:06   ` Jonathan Wakely
2022-03-09 17:40   ` Patrick Palka
2022-03-09 17:56     ` [PATCH] contrib: Fix up git-descr.sh regression [PR102664] Jakub Jelinek
2022-03-09 18:08     ` [PATCH] contrib: Fix non-portable sed commands in gcc-descr [PR102664/] Jonathan Wakely

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 read-only IMAP folder(s) and NNTP newsgroup(s).