From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 2E2443858421 for ; Wed, 19 Jan 2022 16:55:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E2443858421 Received: by mail-wm1-x333.google.com with SMTP id j5-20020a05600c1c0500b0034d2e956aadso6713952wms.4 for ; Wed, 19 Jan 2022 08:55:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7BrlMUJevYlRXMbBiWxVmB3av23C4hvv61tVYVZrWB0=; b=n1/xjCrY6pNW2aLEdF7x8EzQ8Fx7sfanu5qFqP6zUFmO/LyC0j7/xbDTA7gxfmGo43 UGeclpoxDCR4SI2dBOkqjczLLWXqLFVvxy8g3BATl8vsGEQwIl5Dwq8OrdiubN0GSJJe 4h0hj2R02RpBJDGN6RVYF/aL9XT4bY/HrEwuDVyW3VPjVw8vgEZ2PsUZrSyX3AGIXS9s IzaCVw4oZD/iRQcovIiAR0gc44uwaDgr/7cQUWf/X8yly9wbZPnrTshRTu39ralvhJjB gGl2FZs14v3qujl0OsKTGtkJ3dYAgHrgKu7B4RRcHG1UxfgaCdIPQDwntUH+9VrLtCXs B3ng== X-Gm-Message-State: AOAM532vNPI28n1lsB/OiOxG8NpBlIixsOQ8xDZaYW0Llk5xAH3L0asF BNGyXAMgTBa/iDDUVOM6Xy8vqcNJ2Wy8KkK1X68w7g== X-Google-Smtp-Source: ABdhPJwptGfkPCcQn2Hp/LD0Z5MmiaC1wxf3otZccUWU4pqlkUdxIKHrVhJHW4oQiic8T/JZVlh2rlE8Vc14sODdV4E= X-Received: by 2002:a5d:548b:: with SMTP id h11mr29260415wrv.12.1642611310196; Wed, 19 Jan 2022 08:55:10 -0800 (PST) MIME-Version: 1.0 References: <7e803eb3-d9df-99de-490d-823c1ffe29d7@suse.cz> <20211008111246.GF304296@tucnak> <11400b93-b2bb-6133-88f7-20219433f2a7@suse.cz> <12d44ac0-8849-466c-9749-b4e1e7168ac7@suse.cz> <1e75173a-801c-738f-ba3e-ee7c7483986b@suse.cz> <767afbf4-3de5-b74f-45f9-b4ce7d9a8dee@suse.cz> <5f1250ca-297a-dd82-0912-18259512d349@suse.cz> In-Reply-To: <5f1250ca-297a-dd82-0912-18259512d349@suse.cz> From: Eric Gallager Date: Wed, 19 Jan 2022 11:54:58 -0500 Message-ID: Subject: Re: [RFC] Port git gcc-descr to Python To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Martin Jambor , Jakub Jelinek , Jonathan Wakely , gcc-patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KAM_SHORT, 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: Wed, 19 Jan 2022 16:55:12 -0000 On Wed, Jan 19, 2022 at 8:18 AM Martin Li=C5=A1ka wrote: > > On 1/19/22 13:49, Martin Jambor wrote: > > Hi, > > > > On Wed, Jan 19 2022, Martin Li=C5=A1ka wrote: > >> On 10/18/21 11:01, Martin Li=C5=A1ka wrote: > >>> On 10/12/21 10:59, Martin Li=C5=A1ka wrote: > >>>> Hello. > >>>> > >>>> There's a complete patch that implements both git gcc-descr and gcc-= undesrc > >>>> and sets corresponding git aliases to use them. > >>>> > >>>> Ready to be installed? > >>>> Thanks, > >>>> Martin > >>> > >>> All right, so Jakub told me at IRC that we doesn't support porting to= Python. > >>> However, he promised supporting the changes I made in the original sh= ell script. > >> > >> @Jakub: May I remind this, please? > > > > putting the following line in ..git/config seems to do the trick? > > > > gcc-descr =3D "!f() { if test ${1:-no} =3D --short; then c=3D${2:= -master}; r=3D$(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'); = elif test ${1:-no} =3D --full; then c=3D${2:-master}; r=3D$(git describe --= all --abbrev=3D40 --match 'basepoints/gcc-[0-9]*' $c | sed -n 's,^\\(tags/\= \)\\?basepoints/gcc-,r,p'); else c=3D${1:-master}; r=3D$(git describe --all= --abbrev=3D14 --match 'basepoints/gcc-[0-9]*' $c | sed -n 's,^\\(tags/\\)\= \?basepoints/gcc-,r,p'); expr match ${r:-no} '^r[0-9]\\+$' >/dev/null && r= =3D${r}-0-g$(git rev-parse ${2:-master}); fi; if test -n $r; then o=3D$(git= config --get gcc-config.upstream); rr=3D$(echo $r | sed -n 's,^r\\([0-9]\\= +\\)-[0-9]\\+\\(-g[0-9a-f]\\+\\)\\?$,\\1,p'); if git rev-parse --verify --q= uiet ${o:-origin}/releases/gcc-$rr >/dev/null; then m=3Dreleases/gcc-$rr; e= lse m=3Dmaster; fi; git merge-base --is-ancestor $c ${o:-origin}/$m && \\ec= ho ${r}; fi; }; f" > > > > Derived from the following before squashing all the new lines: > > > > if test ${1:-no} =3D --short; then > > c=3D${2:-master}; > > r=3D$(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'); > > elif test ${1:-no} =3D --long; then > > c=3D${2:-master}; > > r=3D$(git describe --all --abbrev=3D40 --match 'basepoints/gcc-[0= -9]*' $c | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-,r,p'); > > else > > c=3D${1:-master}; > > r=3D$(git describe --all --abbrev=3D14 --match 'basepoints/gcc-[0= -9]*' $c | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-,r,p'); > > expr match ${r:-no} '^r[0-9]\\+$' >/dev/null && r=3D${r}-0-g$(git= rev-parse ${2:-master}); > > fi; > > if test -n $r; then > > o=3D$(git config --get gcc-config.upstream); > > rr=3D$(echo $r | sed -n 's,^r\\([0-9]\\+\\)-[0-9]\\+\\(-g[0-9a-f]= \\+\\)\\?$,\\1,p'); > > if git rev-parse --verify --quiet ${o:-origin}/releases/gcc-$rr >= /dev/null; then > > m=3Dreleases/gcc-$rr; > > else > > m=3Dmaster; > > fi; > > git merge-base --is-ancestor $c ${o:-origin}/$m && \\echo ${r}; > > fi; > > Anyway, can we please put the nicely formatted bash script to contrib/git= -describe.sh (contrib/git-undescribe.sh), having that squashed > to one line is just crazy. > > Martin, can you please do that? > > > > > > > (And if you wanted to ask then no, I am not touching > > contrib/gcc-git-customization.sh, not even with a long pole, it scares > > me :-) > > Sure, I can then adjust it if we end up with an outlined version where to= code > sits in proper .sh files. > > Martin > > > > > Martin > > > Hi, while people are modifying contrib/gcc-git-customization.sh, could I get someone to take a look at bug 102644, too? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102664 Thanks, Eric