Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: tools/v8-info.sh

Issue 16802003: Add sample usage / output and -u option (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright 2013 the V8 project authors. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 11 matching lines...) Expand all
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 29
30 ########## Global variable definitions 30 ########## Global variable definitions
31 31
32 BASE_URL="https://code.google.com/p/v8/source/list"
32 VERSION="src/version.cc" 33 VERSION="src/version.cc"
33 MAJOR="MAJOR_VERSION" 34 MAJOR="MAJOR_VERSION"
34 MINOR="MINOR_VERSION" 35 MINOR="MINOR_VERSION"
35 BUILD="BUILD_NUMBER" 36 BUILD="BUILD_NUMBER"
36 PATCH="PATCH_LEVEL" 37 PATCH="PATCH_LEVEL"
37 38
38 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" 39 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
39 40
40 ########## Function definitions 41 ########## Function definitions
41 42
42 cd $V8 43 cd $V8
43 44
44 usage() { 45 usage() {
45 cat << EOF 46 cat << EOF
46 usage: $0 OPTIONS 47 usage: $0 OPTIONS
47 48
48 Fetches V8 revision information from a git-svn checkout. 49 Fetches V8 revision information from a git-svn checkout.
49 50
50 OPTIONS: 51 OPTIONS:
51 -h Show this message. 52 -h Show this message.
53
52 -i Print revision info for all branches matching the V8 version. 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]
57
53 -v Print the V8 version tag for a trunk SVN revision. 58 -v Print the V8 version tag for a trunk SVN revision.
59 Example usage: $0 -v 14981
60 Output format: [V8 version]
61
54 -m Print all patches that were merged to the specified V8 branch. 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]*.
65
55 -p Print all patches merged to a specific V8 point-release. 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]*
69
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
56 EOF 72 EOF
57 } 73 }
58 74
59 tags() { 75 tags() {
60 git for-each-ref --format="%(objectname) %(refname:short)" refs/remotes/svn 76 git for-each-ref --format="%(objectname) %(refname:short)" refs/remotes/svn
61 } 77 }
62 78
63 tag_revision() { 79 tag_revision() {
64 cut -d" " -f1 80 cut -d" " -f1
65 } 81 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 merges_to_branch() { 122 merges_to_branch() {
107 git cherry -v svn/trunk svn/$1 | while read merge; do 123 git cherry -v svn/trunk svn/$1 | while read merge; do
108 h=$(echo $merge | cut -d" " -f2) 124 h=$(echo $merge | cut -d" " -f2)
109 svn=$(svn_rev $1 $h) 125 svn=$(svn_rev $1 $h)
110 merges=$(echo $merge | grep -o "r[0-9]\+") 126 merges=$(echo $merge | grep -o "r[0-9]\+")
111 rev=$(v8_rev $h) 127 rev=$(v8_rev $h)
112 echo $rev r$svn $merges 128 echo $rev r$svn $merges
113 done 129 done
114 } 130 }
115 131
132 url_for() {
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"
137 }
138
116 ########## Option parsing 139 ########## Option parsing
117 140
118 while getopts ":hi:v:m:p:" OPTION ; do 141 while getopts ":hi:v:m:p:u:" OPTION ; do
119 case $OPTION in 142 case $OPTION in
120 h) usage 143 h) usage
121 exit 0 144 exit 0
122 ;; 145 ;;
123 i) tag_version $OPTARG 146 i) tag_version $OPTARG
124 ;; 147 ;;
125 v) v8_rev $(svn_rev trunk r$OPTARG) 148 v) v8_rev $(svn_rev trunk r$OPTARG)
126 ;; 149 ;;
127 m) merges_to_branch $OPTARG 150 m) merges_to_branch $OPTARG
128 ;; 151 ;;
129 p) point_merges "$(tag_log $(v8_hash $OPTARG)^1)" 152 p) echo $(point_merges "$(tag_log $(v8_hash $OPTARG)^1)")
153 ;;
154 u) url_for $OPTARG
130 ;; 155 ;;
131 ?) echo "Illegal option: -$OPTARG" 156 ?) echo "Illegal option: -$OPTARG"
132 usage 157 usage
133 exit 1 158 exit 1
134 ;; 159 ;;
135 esac 160 esac
136 done 161 done
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698