c-family: -Waddress-of-packed-member and casts
[official-gcc.git] / contrib / git-undescr.sh
blob1db67dc6ebf8798255e3d7045357fa43d5bd58c1
1 #!/bin/sh
3 # Script to undescribe a GCC revision
5 o=$(git config --get gcc-config.upstream);
6 r=$(echo $1 | sed -n 's,^r\([0-9][0-9]*\)-[0-9][0-9]*\(-g[0-9a-f]*\)*$,\1,p');
7 n=$(echo $1 | sed -n 's,^r[0-9][0-9]*-\([0-9][0-9]*\)\(-g[0-9a-f]*\)*$,\1,p');
9 test -z $r && echo Invalid id $1 && exit 1;
10 h=$(git rev-parse --verify --quiet ${o:-origin}/releases/gcc-$r);
11 test -z $h && h=$(git rev-parse --verify --quiet ${o:-origin}/master);
12 p=$(git describe --all --match 'basepoints/gcc-'$r $h | sed -n 's,^tags/,,;s,^basepoints/gcc-[0-9][0-9]*-\([0-9][0-9]*\)-g[0-9a-f]*$,\1,p;s,^basepoints/gcc-[0-9][0-9]*$,0,p');
13 git rev-parse --verify $h~$(expr $p - $n);