From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id E90C3385C017 for ; Fri, 16 Jul 2021 09:22:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E90C3385C017 Received: by mail-ej1-x635.google.com with SMTP id dt7so14113325ejc.12 for ; Fri, 16 Jul 2021 02:22:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wmqLAW5Nx7bIPjwbNYpvqjENrU5nIKEACnE9geUWS2k=; b=P5SUEF9eyzAUaBETY2j/nw1ZanQ3EdQBU5vXl4TV/yj3O3+BUsPVPOzHWkS+vnx1nl 6/KzyQlCxTAWAAcK+JyJL4jEL/jfMy7bzKv6BVKXMH3PbY+Mq+NV6pJb4/fF5NzHtfCX gSr+nvmXN5HXM/9eSdChVPmxAEZhYHQCoEoh/KB9b37wCX62pjOEswYOrt5o1ndjhfsu mD8fbw2FxOzzzYfJXo1jgv07dKoVDct8SsKBiBCrcgdvBRwhsXN0CBvnkDegykAD2dzd cJD46UUePjEG1WD+c7qs8D7KtXk6qgUiQHEo7iz7Pd095uuc+VTngb265tpdSpCL9fU4 G3Pw== X-Gm-Message-State: AOAM531ChZm7eOrDTGIDGwvrExq61sA19kPXw6UqnFeCgyVD08bsnRAx +DjEtyTgGo3JlYmGoaCcXv3MBT9VCbubmq1PMIU= X-Google-Smtp-Source: ABdhPJyAT7b5fsK8tUcifp9EIYORNKV6DO6h+ZE2MONFfWiqX9bQDGWnWPPlyZXE+fwRM3vyNRs+sBl6vcX6u2wXHHU= X-Received: by 2002:a17:906:dfdb:: with SMTP id jt27mr11206393ejc.138.1626427358026; Fri, 16 Jul 2021 02:22:38 -0700 (PDT) MIME-Version: 1.0 References: <878s271je5.fsf@depni.sinp.msu.ru> <20210716072941.GC2380545@tucnak> In-Reply-To: <20210716072941.GC2380545@tucnak> From: Richard Biener Date: Fri, 16 Jul 2021 11:22:27 +0200 Message-ID: Subject: Re: [PATCH] gcc_update: use gcc-descr git alias for revision string in gcc/REVISION To: Jakub Jelinek Cc: Serge Belyshev , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2021 09:22:42 -0000 On Fri, Jul 16, 2021 at 9:29 AM Jakub Jelinek 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 > > 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. Note the new form will be more difficult to use for people not having the customizations installed. It also will likely break when gcc-update is not invoked on official branches? So I'm not sure the change is a good one after all... Richard. > Jakub >