diff options
author | Andy Green <andy.green@linaro.org> | 2012-07-05 10:23:53 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-07-05 10:23:53 +0800 |
commit | fc78cc5776df61038a78aea8713a39fa35748da6 (patch) | |
tree | 27ec18c84dd06d0b544af41d7e37425be9e495ff | |
parent | 9b4667e140528865e92d24021664b03b558f9472 (diff) |
add tag graph and updates
Signed-off-by: Andy Green <andy.green@linaro.org>
-rwxr-xr-x | scripts/stg-README.html-update.sh | 102 | ||||
-rwxr-xr-x | scripts/stg-grep | 34 | ||||
-rwxr-xr-x | scripts/stg-picklog-backwards.sh | 34 | ||||
-rwxr-xr-x | scripts/stg-push-to-repo.sh | 27 | ||||
-rwxr-xr-x | scripts/stg-resolve-conflict-add-new.sh | 11 | ||||
-rwxr-xr-x | scripts/stg-resolve-conflict-if-seen-before.sh | 2 | ||||
-rwxr-xr-x | scripts/stg-sync-upstreams.sh | 8 | ||||
-rwxr-xr-x | scripts/stg-tag-graph.sh | 91 | ||||
-rwxr-xr-x | scripts/stg-uplevel-current-branch.sh | 4 |
9 files changed, 295 insertions, 18 deletions
diff --git a/scripts/stg-README.html-update.sh b/scripts/stg-README.html-update.sh index b4a845b..e7b489f 100755 --- a/scripts/stg-README.html-update.sh +++ b/scripts/stg-README.html-update.sh @@ -112,9 +112,15 @@ function print_topic FIND_B_PARENT=$COMMON_PARENT_BASIS fi - if [ $3 -eq 4 ] ; then + # if it's a 2-parent rebase, have to use git + TW=`cat stg-uplevel-current-branch.parents | grep ^$2 | wc -w` + if [ $TW -eq 3 ] ; then + FIND_B_PARENT=`cat stg-uplevel-current-branch.parents | grep "^$2\ .*\ .*" | cut -d' ' -f2` + fi + + if [ $3 -eq 4 -o $TW -eq 3 ] ; then S=`git log --oneline $FIND_B_PARENT..$2 | wc -l` - echo $S >> $OUT + echo "$S" >> $OUT else if [ $3 -eq 5 ] ; then S=`git log --oneline $FIND_B_PARENT..$2 | wc -l` @@ -124,7 +130,7 @@ function print_topic S=$(( $S + $L )) else S=`stg series -b $2 | wc -l` - echo $S >> $OUT + echo "$S" >> $OUT fi fi echo "</span></td>" >> $OUT @@ -162,7 +168,11 @@ function do_children # deal with all the children - NUMCHILDREN=`cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep \ $2\$ | cut -d' ' -f1 | wc -l` + rm -rf .childlist-$NEXTLEV + cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep \ $2\$ | cut -d' ' -f1 > .childlist-$NEXTLEV + cat stg-uplevel-current-branch.parents | grep -v ^# | grep .*\ .*\ .* | grep \ $2\ | cut -d' ' -f1 >> .childlist-$NEXTLEV + + NUMCHILDREN=`wc -l .childlist-$NEXTLEV | cut -d' ' -f1` # echo $1 / $L_RPC : children of $2 == $NUMCHILDREN @@ -172,7 +182,7 @@ function do_children fi if [ $NUMCHILDREN -eq 1 ] ; then - CHILD=`cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep \ $2\$ | cut -d' ' -f1` + CHILD=`cat .childlist-$NEXTLEV` print_topic $1 $CHILD 0 L_RPC=$(( $L_RPC + $S )) do_children $1 $CHILD $L_RPC @@ -183,7 +193,7 @@ function do_children print_summary $1 $L_RPC - for i in `cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep \ $2\$ | cut -d' ' -f1` ; do + for i in `cat .childlist-$NEXTLEV` ; do if [ "$i" != "$2" ] ; then # echo " doing child $NEXTLEV $i $L_RPC" print_topic $NEXTLEV $i $L_RPC 0 @@ -229,6 +239,7 @@ cat README.html | while read line ; do cat $REPORTS | grep ^$s\ $FILTER | while read qq ; do H=`echo $qq | cut -d' ' -f3` COMMENT=`echo $qq | cut -d' ' -f5-` + if [ "$H" == "$FILTER_HEAD" ] ; then # it'll be the last one if seen if [ -z "$COMMENT" ] ; then @@ -288,12 +299,12 @@ cat README.html | while read line ; do continue fi - if [ ! -z "`echo $line | grep '<!--RUNNING'`" ] ; then + if [ ! -z "`echo $line | grep '<!--RUNNING '`" ] ; then echo "<table width=\"100%\" cellspacing=\"3\" cellpadding=\"3\">" >> $OUT FILTER="`echo $line | cut -d' ' -f2`" - INITIAL=`cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep $FILTER | head -n 1` + INITIAL=`cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep ^$FILTER | head -n 1` if [ ! -z "$INITIAL" ] ; then # treat as a topic series @@ -353,9 +364,84 @@ cat README.html | while read line ; do continue; fi + if [ ! -z "`echo $line | grep '<!--RUNNING2'`" ] ; then + + echo "<table width=\"100%\" cellspacing=\"3\" cellpadding=\"3\">" >> $OUT + + FILTER="`echo $line | cut -d' ' -f2`" + INITIAL=`cat stg-uplevel-current-branch.parents | grep -v ^# | grep -v .*\ .*\ .* | grep $FILTER | head -n 1` + if [ ! -z "$INITIAL" ] ; then + + # treat as a topic series + + FIRST=`echo $INITIAL | cut -d ' ' -f 1` + PARENT=`echo $INITIAL | cut -d ' ' -f 2` + print_topic 0 $PARENT 4 + SS=$S + print_topic 1 $FIRST 0 + SS=$(( $SS + $S )) + do_children 1 $FIRST $SS + else + + INITIAL=`cat stg-uplevel-current-branch.parents | grep -v ^# | grep ^$FILTER | head -n 1` + + B=`echo $INITIAL | cut -d' ' -f2` + find_branch_parent $B + if [ "$B" != "$FIND_B_PARENT" ] ; then + COMMON_PARENT_BASIS=$FIND_B_PARENT + else + B=`echo $INITIAL | cut -d' ' -f3` + find_branch_parent $B + if [ "$B" != "$FIND_B_PARENT" ] ; then + COMMON_PARENT_BASIS=$FIND_B_PARENT + else + echo "unable to deduce common branch ancestor..." + fi + fi + # it's a rebase story + + echo >> $OUT + echo "<tr>" >> $OUT + echo "<td>" >> $OUT + echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"1\">" >> $OUT + print_topic 0 `echo $INITIAL | cut -d' ' -f2` 4 + echo "</table>" >> $OUT + echo "</td></tr>" >> $OUT + echo >> $OUT + echo "<tr><td align=\"center\">rebased with</td></tr>" >> $OUT + echo >> $OUT + echo "<tr><td>" >> $OUT + echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"1\">" >> $OUT + print_topic 0 `echo $INITIAL | cut -d' ' -f3` 4 + echo "</table>" >> $OUT + echo "</td></tr>" >> $OUT + echo >> $OUT + echo "<tr><td align=\"center\">produces</td></tr>" >> $OUT + echo >>$OUT + echo "<tr><td align=\"center\">" >> $OUT + echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"1\">" >> $OUT + print_topic 0 `echo $INITIAL | cut -d' ' -f1` 5 + echo "</table>" >> $OUT + echo "</td></tr>" >>$OUT + echo >> $OUT + fi + + echo "</table>" >> $OUT + + continue; + fi + echo $line | sed "s!\$GITWEB_BRANCH!$GITWEB_BRANCH!g" >> $OUT done scp $OUT $CREDS:$REPO/README.html +echo doing tilt graph data + +stg-tag-graph.sh "tilt-3.[345]" graph-data llt-linux-linaro-core-tracking tilt-tracking + +gnuplot plot + +scp plot.png $STORAGE_SERVER/plot-patchload-tilt-tracking.png + diff --git a/scripts/stg-grep b/scripts/stg-grep new file mode 100755 index 0000000..472d0e4 --- /dev/null +++ b/scripts/stg-grep @@ -0,0 +1,34 @@ +#!/bin/bash + +if [ -z "$1" ] ; then + echo "Looks in all known branches for stgit patch with name matching regexp" + echo "Usage: $0 <regexp>" + exit 1 +fi + +cat stg-uplevel-current-branch.parents | grep -v ^# | cut -d' ' -f1 | grep -v ^\$ | while read line ; do + + R=`stg ser -b $line | grep "$1"` + if [ ! -z "$R" ] ; then + echo -n "$line:" + stg ser -b $line | grep "$1" + fi + + C=`stg ser -b $line --noprefix | head -n1` + L=`stg show -b $line $C | grep ^commit | head -n1 | cut -d' ' -f2` + + CT=`stg ser -b $line --noprefix | tail -n1` + LT=`stg show -b $line $C | grep ^commit | head -n1 | cut -d' ' -f2` + + CNT=3 + for i in `git log $line --pretty=format:%H $L..$LT | tac`; do + if [ ! -z "`echo $i | grep ^$1`" ] ; then + echo -n "$line:" + stg ser -b $line --noprefix | head -n $CNT | tail -n 1 + fi + CNT=$(( $CNT + 1 )) + done + + +done + diff --git a/scripts/stg-picklog-backwards.sh b/scripts/stg-picklog-backwards.sh index 945115e..0d76a93 100755 --- a/scripts/stg-picklog-backwards.sh +++ b/scripts/stg-picklog-backwards.sh @@ -5,11 +5,43 @@ if [ -z "$1" ] ; then exit 1 fi +mkdir -p .tmp +touch .tmp/LAST + cat $1 | grep -v ^\$ > $1._ cat $1._ | tac | while read line ; do - stg pick `echo $line | cut -d' ' -f1` + COMM=`echo $line | cut -d' ' -f1` + if [ -z "$COMM" ] ; then + COMM=$line + fi + LOG= + if [ ! -z "`echo $line | grep ' '`" ] ; then + LOG=`echo $line | cut -d' ' -f2-` + fi + LAST=`cat .tmp/LAST` + echo $COMM > .tmp/LAST + + if [ -z "`git show $COMM | head -n 2 | grep ^Merge:`" ] ; then + if [ ! -z "$LOG" ] ; then + stg pick $COMM + fi + else + N=`git log --pretty=%s -n 1 $COMM | sed 's/\ /\-/g' | sed 's/\:/\-/g' | sed 's/\.\./\-/g'` + echo $LAST..$COMM + echo $N + git log --pretty=medium -n 1 $COMM > .tmp/$N + git diff $LAST..$COMM >> .tmp/$N + if [ $? -ne 0 ] ; then + exit 1 + fi + stg import .tmp/$N + if [ $? -ne 0 ] ; then + exit 1 + fi + fi + if [ $? -ne 0 ] ; then exit 1 fi diff --git a/scripts/stg-push-to-repo.sh b/scripts/stg-push-to-repo.sh index a7963eb..f5ce5ed 100755 --- a/scripts/stg-push-to-repo.sh +++ b/scripts/stg-push-to-repo.sh @@ -71,6 +71,8 @@ for i in `cat .upload-repolist | sort | uniq` ; do N1=`echo $n | cut -d'=' -f1` N2=`echo $n | cut -d'=' -f2` + echo $i $N1 $N2 + if [ "$i" == "$N2" ] ; then for q in `echo $ALWAYSTAG_LIST` ; do @@ -87,6 +89,31 @@ for i in `cat .upload-repolist | sort | uniq` ; do done + # deal with unified public equivalences + # so a public branch is just a copy of a private local one + # and needs to be in lock-step + + for n in $UNI_NAMES ; do + + N1=`echo $n | cut -d'=' -f1` + N2=`echo $n | cut -d'=' -f2` + + if [ "$i" == "$N2" ] ; then + + for q in `echo $ALWAYSTAG_LIST` ; do + if [ "$N1" == "$q" ] ; then + TAG=$N1-`date +"%Y-%m-%d-%H-%M-%Z"` + git tag $TAG $N1 + tags=1 + fi + done + + git push ssh://$CREDS/$UNIFIED_REPO +$i:$N1 + + fi + + done + done if [ -z "$did" ] ; then diff --git a/scripts/stg-resolve-conflict-add-new.sh b/scripts/stg-resolve-conflict-add-new.sh index b4358d6..4293a1e 100755 --- a/scripts/stg-resolve-conflict-add-new.sh +++ b/scripts/stg-resolve-conflict-add-new.sh @@ -4,18 +4,13 @@ # Part of LT Integration Tools # Licensed under GPL3 -if [ -z "$1" ] ; then - - echo "Usage: $0 <name of conflict>" - exit 1 - -fi +NAME=`date +%s` if [ ! -d auto-rebase-fixes ] ; then mkdir auto-rebase-fixes fi -echo $1 > .resolve-last-name +echo $NAME > .resolve-last-name rm -rf .resolve-stash mkdir .resolve-stash @@ -31,5 +26,5 @@ for i in `git status | grep both | tr -s ' ' | cut -d' ' -f3` ; do done -git diff > auto-rebase-fixes/$1.conflict +git diff > auto-rebase-fixes/$NAME.conflict diff --git a/scripts/stg-resolve-conflict-if-seen-before.sh b/scripts/stg-resolve-conflict-if-seen-before.sh index a69279f..9fc14d9 100755 --- a/scripts/stg-resolve-conflict-if-seen-before.sh +++ b/scripts/stg-resolve-conflict-if-seen-before.sh @@ -8,7 +8,7 @@ git diff > .resolve-current-diff for i in `ls auto-rebase-fixes/*.conflict` ; do - if [ -z "`diff -urN .resolve-current-diff $i`" ] ; then + if [ -z "`diff -urN .resolve-current-diff $i | tail -n+3 | grep -v ^+@@@ | grep -v ^-@@@ | grep -v ^+index | grep -v ^-index | grep -v @@ | grep -v ^\\ `" ] ; then solution=`echo $i | sed s/.conflict/.solution/g` skip=`echo $i | sed s/.conflict/.skip/g` diff --git a/scripts/stg-sync-upstreams.sh b/scripts/stg-sync-upstreams.sh index fc10d2a..6e28439 100755 --- a/scripts/stg-sync-upstreams.sh +++ b/scripts/stg-sync-upstreams.sh @@ -60,6 +60,14 @@ if [ -e .stg-sync-changed ] ; then echo fi +if [ ! -z "`echo $1 | grep ^llt`" -o ! -z "`echo $1 | grep ^linux-2.6`" ] ; then + + echo "graph data update" + stg-tag-graph.sh "^v3.[3-9]" mainline-data llt-linux-linaro-core-tracking + stg-tag-graph.sh "^v3.[3-9]" mainline-data linux-2.6-master + +fi + echo "Done" exit 0 diff --git a/scripts/stg-tag-graph.sh b/scripts/stg-tag-graph.sh new file mode 100755 index 0000000..384e31b --- /dev/null +++ b/scripts/stg-tag-graph.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +. stg-push-repos.config + +function commit_date_to_DATE() +{ + datestring="`git show -s --format="%ci" $1 | tail -n1 | cut -d' ' -f1-2`" + DATE=`date --utc --date "$datestring" +%s` +} + +function original_date_to_DATE() +{ + datestring="`git show $1 | grep ^Date: | tr -s ' ' | cut -d' ' -f2-6`" + DATE=`date --utc --date "$datestring" +%s` +} + +function shorten_to_SHORT() +{ + SHORT= + FIRST= + for i in `echo $1 | tr '-' ' '` ; do + if [ -z "`echo $i | grep '[[:alpha:]]'`" ] ; then + if [ -z "$FIRST" ] ; then + FIRST=x + else + SHORT=$SHORT- + fi + SHORT=$SHORT$i + fi + done +} + +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then + echo "Usage: $0 <regexp to filter tags> <output> <basis branch> [additional branch]" + exit 1 +fi + +#git tag | grep tilt-3.[34] | grep -v android | sort -V | while read line ; do +#git tag | grep ^v3.[0-9] | sort -V | while read line; do + +git tag | grep "$1" | grep -v android | sort -V > /tmp/_headlist + +rm -f .actual + +if [ ! -z "$4" ] ; then + + echo $4 > .actual + + for it in $PUBLIC_NAMES ; do + if [ ! -z "`echo "$it" | grep "^$4="`" ] ; then + match=`echo "$it" | cut -d'=' -f2` + echo $match > .actual + fi + done + cat .actual >> /tmp/_headlist +fi + +# snip tracking branch + +if [ -e $2 -a -e .actual ] ; then + match=`cat .actual` + echo "stripping $match from $2" + cat $2 | grep -v ^$match > $2.1 + rm $2 + mv $2.1 $2 +fi + +cat /tmp/_headlist | while read line; do + + if [ ! -z "`cat $2 | cut -f1 | grep "^$line\$"`" ] ; then + echo skipping $line + continue + fi + + commit_date_to_DATE $line + date=$DATE + diff -u <(git rev-list --first-parent $line) <(git rev-list --first-parent $3) | sed -ne 's/^ //p' | head -1 >.basen + base=`cat .basen` + original_date_to_DATE $base + count=`git rev-list $base..$line | wc -l` + + if [ "$line" = "$match" ] ; then + SHORT="tracking" + else + shorten_to_SHORT $line + fi + + echo -e $line\\t$count\\t$date\\t$DATE\\t$SHORT >> $2 + +done + diff --git a/scripts/stg-uplevel-current-branch.sh b/scripts/stg-uplevel-current-branch.sh index 2384010..37949e2 100755 --- a/scripts/stg-uplevel-current-branch.sh +++ b/scripts/stg-uplevel-current-branch.sh @@ -31,6 +31,8 @@ fi echo "going around on branch $B" +stg clean + state=0 touch .stg-uplevel-idle @@ -139,6 +141,8 @@ cat $PARENTLIST | while read line ; do die fi + stg clean + echo "Moving to branch \"$NEXT\"" stg branch $NEXT |