On Mon, Jul 19, 2021 at 02:53:13PM +0100, Richard Earnshaw wrote: > > 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.
git merge-base --is-ancestor test should fail on those branches, origin/releases/gcc-11 or origin/master etc. will then not have your HEAD as their ancestor. Jakub