Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 # Copyright 2013 the V8 project authors. All rights reserved. | |
| 3 # Redistribution and use in source and binary forms, with or without | |
| 4 # modification, are permitted provided that the following conditions are | |
| 5 # met: | |
| 6 # | |
| 7 # * Redistributions of source code must retain the above copyright | |
| 8 # notice, this list of conditions and the following disclaimer. | |
| 9 # * Redistributions in binary form must reproduce the above | |
| 10 # copyright notice, this list of conditions and the following | |
| 11 # disclaimer in the documentation and/or other materials provided | |
| 12 # with the distribution. | |
| 13 # * Neither the name of Google Inc. nor the names of its | |
| 14 # contributors may be used to endorse or promote products derived | |
| 15 # from this software without specific prior written permission. | |
| 16 # | |
| 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 28 | |
| 29 | |
| 30 ########## Global variable definitions | |
| 31 | |
| 32 DEPS_STRING='"v8_revision":' | |
| 33 INFO=tools/v8-info.sh | |
| 34 | |
| 35 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| 36 | |
| 37 ########## Option parsing | |
| 38 | |
| 39 REVISIONS=1 | |
| 40 START=HEAD | |
| 41 | |
| 42 while getopts ":hn:s:" OPTION ; do | |
| 43 case $OPTION in | |
| 44 h) usage | |
|
Jakob Kummerow
2013/06/12 10:31:07
This isn't JavaScript. There are rules. You can't
Toon Verwaest
2013/06/12 10:43:16
Done.
| |
| 45 exit 0 | |
| 46 ;; | |
| 47 n) REVISIONS=$OPTARG | |
| 48 ;; | |
| 49 s) START=$OPTARG | |
| 50 ;; | |
| 51 ?) echo "Illegal option: -$OPTARG" | |
| 52 usage | |
| 53 exit 1 | |
| 54 ;; | |
| 55 esac | |
| 56 done | |
| 57 | |
| 58 ########## Function definitions | |
| 59 | |
| 60 usage() { | |
| 61 cat << EOF | |
| 62 usage: $0 OPTIONS | |
| 63 | |
| 64 Run in chromium/src to get information about V8 rolls. | |
| 65 | |
| 66 OPTIONS: | |
| 67 -h Show this message. | |
| 68 -n Number of rolls to print information about. | |
| 69 -s Chromium git hash to start printing V8 information about. | |
| 70 EOF | |
| 71 } | |
| 72 | |
| 73 v8_line() { | |
| 74 git show $1:DEPS | grep -n $DEPS_STRING | cut -d":" -f1 | |
| 75 } | |
| 76 | |
| 77 v8_info() { | |
| 78 git blame -L$(v8_line $1),+1 $1 DEPS | grep $DEPS_STRING | |
| 79 } | |
| 80 | |
| 81 v8_svn() { | |
| 82 sed -e 's/^.*"\([0-9]\+\)",$/\1/' | |
| 83 } | |
| 84 | |
| 85 v8_roll() { | |
| 86 cut -d" " -f1 | |
| 87 } | |
| 88 | |
| 89 find_rev() { | |
| 90 git svn find-rev $1 | |
| 91 } | |
| 92 | |
| 93 msg() { | |
| 94 msg=$(git log --format="%h %ci %ce" -1 $1) | |
| 95 h=$(echo $msg | cut -d" " -f1) | |
| 96 d=$(echo $msg | cut -d" " -f2) | |
| 97 t=$(echo $msg | cut -d" " -f3) | |
| 98 a=$(echo $msg | cut -d" " -f5) | |
| 99 a1=$(echo $a | cut -d"@" -f1) | |
| 100 a2=$(echo $a | cut -d"@" -f2) | |
| 101 echo $h $d $t $a1@$a2 | |
| 102 } | |
| 103 | |
| 104 v8_revision() { | |
| 105 cd $V8 | |
| 106 $INFO -v $1 | |
| 107 } | |
| 108 | |
| 109 rolls() { | |
| 110 roll=$2 | |
| 111 for i in $(seq 1 $1); do | |
| 112 info=$(v8_info $roll) | |
| 113 roll=$(echo $info | v8_roll $roll) | |
| 114 trunk=$(echo $info | v8_svn $roll) | |
| 115 echo "$(v8_revision $trunk) $trunk $(find_rev $roll) $(msg $roll)" | |
| 116 roll=$roll^1 | |
| 117 done | |
| 118 } | |
| 119 | |
| 120 rolls $REVISIONS $START | |
| OLD | NEW |