This is an automated email from the git hooks/post-receive script.
christophe.lyon pushed a commit to branch master in repository toolchain/backport-tools.
The following commit(s) were added to refs/heads/master by this push: new b96c27f Switch to git-only branches, without ChangeLog.lina [...] b96c27f is described below
commit b96c27f64cfae8b414fa92f8cd55e845483f2699 Author: Christophe Lyon christophe.lyon@linaro.org Date: Fri Jul 10 16:17:41 2015 +0200
Switch to git-only branches, without ChangeLog.linaro files. --- linaro-gcc-git-review-backport-tree.sh | 46 ++++++++++++++-------------------- 1 file changed, 19 insertions(+), 27 deletions(-)
diff --git a/linaro-gcc-git-review-backport-tree.sh b/linaro-gcc-git-revi [...] index 67354b9..21c9f15 100755 --- a/linaro-gcc-git-review-backport-tree.sh +++ b/linaro-gcc-git-review-backport-tree.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e
if [ $# -lt 2 ] then @@ -21,12 +22,24 @@ fi mydir=`dirname $0` mydir=`(cd $mydir ; pwd)`
+# Remove ChangeLog changes from the SVN patch, and group them in a +# dedicated file. Now that we use git branches and no longer use +# ChangeLog, we don't want to create ChangeLog.linaro, but we still +# want to check that the commit message contains the right ChangeLog +# entries. extract_changelog() { MYSVNID=$1 MYPATCH=../../reviews/$MYSVNID.svn MYCL=../../reviews/$MYSVNID.cl - rm -f $MYCL.* + rm -f $MYCL + + # Extract the git commit message + GIT_LINE_END_CL=`egrep -n '^Change-Id: ' ../../reviews/$MYSVNID.git | \ + head -n 1 | cut -d: -f1` + head -n ${GIT_LINE_END_CL} ../../reviews/$MYSVNID.git > ../../review [...] + + # Extract the svn ChangeLog entries NUMCL=`egrep -c 'Index: .*ChangeLog.linaro' $MYPATCH` while [ $NUMCL -gt 0 ] do @@ -44,30 +57,17 @@ extract_changelog() ((LINEEND=LINEEND-1)) fi
- # Extract ChangeLog entry - SUBDIR=`sed -n "$LINESTART"p $MYPATCH | cut -d' ' -f2 | sed 's|/[^/]*$||'` - SUBDIRNAME=`echo $SUBDIR | sed 's|/|_|g'` - echo SUBDIR=$SUBDIR - echo SUBDIRNAME=$SUBDIRNAME - - if [ ! -f $MYCL.$SUBDIRNAME ] - then - touch $MYCL.$SUBDIRNAME - fi - sed -n "$LINESTART,$LINEEND"p $MYPATCH | egrep '^[+]' | \ grep -v '+++' | sed 's/^+//' | \ - sed 's/^([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])/\t\1/' > $MYCL.tmp - - cat $MYCL.tmp $MYCL.$SUBDIRNAME > $MYCL.tmp2 - mv $MYCL.tmp2 $MYCL.$SUBDIRNAME - rm -f $MYCL.tmp + sed 's/^([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])/\t\1/' >> $MYCL
# Remove ChangeLog entry from patch sed "$LINESTART,$LINEEND"d $MYPATCH > $MYPATCH.tmp mv $MYPATCH.tmp $MYPATCH
- NUMCL=`egrep -c 'Index: .*ChangeLog.linaro' $MYPATCH` + # Use || true to avoid exiting when reaching EOF because of + # set -e + NUMCL=`egrep -c 'Index: .*ChangeLog.linaro' $MYPATCH || true` done }
@@ -111,18 +111,10 @@ cd ../backport-for-svn-patch echo APPLYING SVN PATCH patch -p0 -i ../../reviews/$SVNID.svn
-for i in ../../reviews/$SVNID.cl.* -do - echo Patch ChangeLog $i - SUBDIR=`echo $i | sed -e "s/.*$SVNID.cl.//" -e 's|_|/|g'` - echo " SUBDIR=$SUBDIR" - cat $i $SUBDIR/ChangeLog.linaro > $SUBDIR/ChangeLog.linaro.tmp && mv [...] - rm $i -done - cd .. echo DIFFING... diff -r --exclude=.git backport-for-???-patch | less +diff ../reviews/$SVNID.cl ../reviews/$SVNID.git.cl || true
echo If the patch looks OK, comment with: echo -----------------------