Skip to content

Commit aa04401

Browse files
Add sample usage / output and -u option
[email protected] Review URL: https://chromiumcodereview.appspot.com/16802003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@15091 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent 30ad75b commit aa04401

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

tools/v8-info.sh

+27-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
########## Global variable definitions
3131

32+
BASE_URL="https://code.google.com/p/v8/source/list"
3233
VERSION="src/version.cc"
3334
MAJOR="MAJOR_VERSION"
3435
MINOR="MINOR_VERSION"
@@ -49,10 +50,25 @@ Fetches V8 revision information from a git-svn checkout.
4950
5051
OPTIONS:
5152
-h Show this message.
53+
5254
-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+
5358
-v Print the V8 version tag for a trunk SVN revision.
59+
Example usage: $0 -v 14981
60+
Output format: [V8 version]
61+
5462
-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+
5566
-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
5672
EOF
5773
}
5874

@@ -113,9 +129,16 @@ merges_to_branch() {
113129
done
114130
}
115131

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+
116139
########## Option parsing
117140

118-
while getopts ":hi:v:m:p:" OPTION ; do
141+
while getopts ":hi:v:m:p:u:" OPTION ; do
119142
case $OPTION in
120143
h) usage
121144
exit 0
@@ -126,7 +149,9 @@ while getopts ":hi:v:m:p:" OPTION ; do
126149
;;
127150
m) merges_to_branch $OPTARG
128151
;;
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
130155
;;
131156
?) echo "Illegal option: -$OPTARG"
132157
usage

0 commit comments

Comments
 (0)