public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Richard Biener <richard.guenther@gmail.com>
Cc: Serge Belyshev <belyshev@depni.sinp.msu.ru>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] gcc_update: use gcc-descr git alias for revision string in gcc/REVISION
Date: Mon, 19 Jul 2021 14:53:13 +0100	[thread overview]
Message-ID: <fe7792ec-7f05-928c-1085-fcb1a36b6d98@foss.arm.com> (raw)
In-Reply-To: <20210716072941.GC2380545@tucnak>

On 16/07/2021 08:29, Jakub Jelinek via Gcc-patches wrote:
> On Fri, Jul 16, 2021 at 09:06:01AM +0200, Richard Biener via Gcc-patches wrote:
>> On Thu, Jul 15, 2021 at 9:12 PM Serge Belyshev
>> <belyshev@depni.sinp.msu.ru> wrote:
>>>
>>> This is to make development version string more readable, and
>>> to simplify navigation through gcc-testresults.
>>>
>>> Currently gcc_update uses git log --pretty=tformat:%p:%t:%H to
>>> generate version string, which is somewhat excessive since conversion
>>> to git because commit hashes are now stable.
>>>
>>> Even better, gcc-git-customization.sh script provides gcc-descr alias
>>> which makes prettier version string, and thus use it instead (or just
>>> abbreviated commit hash when the alias is not available).
>>>
>>> Before: [master revision b25edf6e6fe:e035f180ebf:7094a69bd62a14dfa311eaa2fea468f221c7c9f3]
>>> After: [master r12-2331]
>>>
>>> OK for mainline?
>>
>> Can you instead open-code gcc-descr in this script?
> 
> Yeah, that will mean consistency no matter whether one has the
> customizations installed or not.
> And, you don't want the effect of $GCC_GIT gcc-descr but $GCC_GIT gcc-descr HEAD
> (the default is $GCC_GIT gcc-descr master).
> As you want to use gcc-descr without --full, I think
> 	revision=`$GCC_GIT log -n1 --pretty=tformat:%h`
> 	r=`$GCC_GIT describe --all --match 'basepoints/gcc-[0-9]*' HEAD \
> 	   | 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'`;
> 	if test -n $r; then
> 		o=`$GCC_GIT config --get gcc-config.upstream`;
> 		rr=`echo $r | sed -n 's,^r\([0-9]\+\)-[0-9]\+\(-g[0-9a-f]\+\)\?$,\1,p'`;
> 		if $GCC_GIT rev-parse --verify --quiet ${o:-origin}/releases/gcc-$rr >/dev/null; then
> 			m=releases/gcc-$rr;
> 		else
> 			m=master;
> 		fi;
> 		if $GCC_GIT merge-base --is-ancestor HEAD ${o:-origin}/$m; then
> 			revision=$r;
> 		fi
> 	fi
> will do it.  Perhaps rename the r, o, rr and m temporaries.
> 
> 	Jakub
> 

Isn't this going to do the wrong thing on any branch that isn't master
or a release branch?  I don't think git gcc-descr is meaningful outside
of those contexts.

R.

  parent reply	other threads:[~2021-07-19 13:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 19:12 Serge Belyshev
2021-07-16  7:06 ` Richard Biener
2021-07-16  7:29   ` Jakub Jelinek
2021-07-16  9:22     ` Richard Biener
2021-07-16  9:36       ` Jakub Jelinek
2021-07-16  9:39         ` Richard Biener
2021-07-16 10:37           ` [PATCH v2] gcc_update: use human readable name " Serge Belyshev
2021-07-19 10:39             ` Richard Biener
2021-07-19 10:47               ` Iain Sandoe
2021-07-19 11:09                 ` Jakub Jelinek
2021-07-19 11:23                   ` [PATCH v3] " Serge Belyshev
2021-09-06  9:49                     ` Serge Belyshev
2021-09-06  9:54                       ` Jakub Jelinek
2021-09-06 13:01                         ` Serge Belyshev
2021-07-19 13:53     ` Richard Earnshaw [this message]
2021-07-19 14:09       ` [PATCH] gcc_update: use gcc-descr git alias " Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe7792ec-7f05-928c-1085-fcb1a36b6d98@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=belyshev@depni.sinp.msu.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).