On Tue, Jan 14, 2020 at 04:52:12PM +0100, Jakub Jelinek wrote:
> The following command prints the same string as DATESTAMP file
> contains in all gcc-7 and later based branches I've tried so far (and nothing 
> when
> e.g. invoked from within svn checkout).

Jonathan wondered on IRC about the weirdo hardcoded check for releases/gcc-9.
The intent was to punt if it isn't a git tree at all, or e.g. somebody
unpacks gcc tarball without gcc/DATESTAMP file in it into his git tracked
home directory.

Perhaps better might be start with
if git merge-base --is-ancestor 633c65dda889eb887fb6ce3b04cefdeb4a69b0b3 HEAD; 
then ... ; fi
to verify it is GCC 8+ (for older we of course would never omit
gcc/DATESTAMP).

> o=$(git config --get gcc-config.upstream); test -z "$o" && o=origin; r=$(cat 
> BASE-VER | cut -d. -f 1); b=; if git rev-parse --verify --quiet 
> $o/releases/gcc-$r >/dev/null; then b=origin/releases/gcc-$r; elif git 
> rev-parse --verify --quiet $o/releases/gcc-9 >/dev/null; then b=$o/master; 
> fi; test -n "$b" && TZ=UTC LC_ALL=C git log --date=iso -1 $(git merge-base 
> HEAD $b) | sed -n 's/^Date:[[:blank:]]*//p' | sed 's/ .*$//;s/-//g'

        Jakub

Reply via email to