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
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.
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.
30 ########## Global variable definitions
32 BASE_URL="https://code.google.com/p/v8/source/list"
33 VERSION="src/version.cc"
39 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
41 ########## Function definitions
49 Fetches V8 revision information from a git-svn checkout.
54 -i Print revision info for all branches matching the V8 version.
55 Example usage: $0 -i 3.19.10$
56 Output format: [Git hash] [SVN revision] [V8 version]
58 -v Print the V8 version tag for a trunk SVN revision.
59 Example usage: $0 -v 14981
60 Output format: [V8 version]
62 -m Print all patches that were merged to the specified V8 branch.
63 Example usage: $0 -m 3.18
64 Output format: [V8 version] [SVN revision] [SVN patch merged]*.
66 -p Print all patches merged to a specific V8 point-release.
67 Example usage: $0 -p 3.19.12.1
68 Output format: [SVN patch merged]*
70 -u Print a link to all SVN revisions between two V8 revision tags.
71 Example usage: $0 -u 3.19.10:3.19.11
76 git for-each-ref --format="%(objectname) %(refname:short)" refs/remotes/svn
84 git log --format="%h %ci %ce %s" -1 $1
88 tags | grep "svn/tags/$1$" | tag_revision
92 echo $1 | grep -o "r[0-9]\+"
96 git svn log -1 --oneline $1 | cut -d" " -f1
100 tags | grep svn/tags/$1 | while read tag; do
101 id=$(echo $tag | grep -o "[^/]*$")
102 rev=$(echo $tag | tag_revision)
103 svn=$(hash_to_svn $rev)
109 git svn find-rev $2 svn/$1
113 cd $(git rev-parse --show-toplevel)
114 rev=$(git show $1:$VERSION \
116 | grep "$MAJOR\|$MINOR\|$BUILD\|$PATCH" \
117 | grep -o "[0-9]\+$" \
123 git cherry -v svn/trunk svn/$1 | while read merge; do
124 h=$(echo $merge | cut -d" " -f2)
126 merges=$(echo $merge | grep -o "r[0-9]\+")
128 echo $rev r$svn $merges
133 first=$(svn_rev trunk $(v8_hash $(echo $1 | cut -d":" -f1)))
134 last=$(svn_rev trunk $(v8_hash $(echo $1 | cut -d":" -f2)))
135 num=$[ $last - $first]
136 echo "$BASE_URL?num=$num&start=$last"
139 ########## Option parsing
141 while getopts ":hi:v:m:p:u:" OPTION ; do
146 i) tag_version $OPTARG
148 v) v8_rev $(svn_rev trunk r$OPTARG)
150 m) merges_to_branch $OPTARG
152 p) echo $(point_merges "$(tag_log $(v8_hash $OPTARG)^1)")
156 ?) echo "Illegal option: -$OPTARG"