Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
457ccf2d
Commit
457ccf2d
authored
4 years ago
by
Anton Hansson
Committed by
Gerrit Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Add a tool to dump git SHAs of API changes"
parents
159a6355
8caea0d4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/dump_api_shas.sh
+56
-0
56 additions, 0 deletions
api/dump_api_shas.sh
with
56 additions
and
0 deletions
api/dump_api_shas.sh
0 → 100755
+
56
−
0
View file @
457ccf2d
#!/bin/bash -e
# This script dumps the git SHAs of all commits inside api tracking directories.
# It can used by tools wanting to track API changes, and the primary original
# purpose is to verify verify all API change SHAs have been tracked by the
# server-side API-council tools.
#
# The only argument is used to specify a git commit range to filter by.
#
# Example invocation (API changes between O and P):
# frameworks/base/api/dump_api_shas.sh origin/oreo-dev..origin/pie-dev
set
-o
pipefail
eecho
()
{
echo
$@
>
&2
;
}
if
[[
$1
==
*
..
*
]]
;
then
exclude
=
${
1
/..*
}
include
=
${
1
/*..
}
else
eecho No range or invalid range specified, defaulting to all commits from HEAD.
exclude
=
include
=
HEAD
fi
eecho
-n
building queryview...
{
source
build/envsetup.sh
&&
lunch aosp_arm
&&
m queryview
;
}
>
/dev/null 2>&1
\
||
{
eecho failed
;
exit
1
;
}
eecho
"done"
# This finds the directories where the dependant java_sdk_libs are defined
bpdirs
=
$(
bazel query
--config
=
queryview
--output
=
package
\
'kind(java_sdk_library, deps(//frameworks/base/api/..., 1))'
2>/dev/null
echo
frameworks/base/core/api
# Not a java_sdk_library.
echo
frameworks/base/services/api
# Not a java_sdk_library.
)
# Find relevant api subdirectories
apidirs
=
$(
find
$bpdirs
-type
f
-name
'*current.txt'
-path
'*/api/*'
\
| xargs
realpath
--relative-to
=
$(
pwd
)
| xargs
dirname
|
sort
|
uniq
)
# Dump sorted SHAs of commits in these directories
{
for
d
in
$apidirs
;
do
(
cd
$d
eecho inspecting
$d
exclude_arg
=
$(
test
-n
"
$exclude
"
&&
{
git rev-parse
-q
--verify
$exclude
>
/dev/null
&&
echo
"--not
$exclude
"
\
||
eecho
"
$d
has no revision
$exclude
, including all commits"
;
}
||
true
)
for
f
in
$(
find
.
-name
'*current.txt'
)
;
do
git
--no-pager
log
--pretty
=
format:%H
--no-merges
--follow
$include
$exclude_arg
--
$f
echo
# No trailing newline with --no-pager
done
)
done
;
}
|
sort
|
uniq
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment