diff options
| author | 2018-09-11 16:26:48 -0700 | |
|---|---|---|
| committer | 2018-09-11 16:26:48 -0700 | |
| commit | 6af9cdf137c4fd907c0a612b47996c906416d8db (patch) | |
| tree | e2e4100db2648b665296c5d236ea3e1adfb4a4d1 | |
| parent | 76b988ad23816009572e7fd4458842548031163f (diff) | |
| parent | ac2b7439d9857807df81642a71981c1f87fbb777 (diff) | |
Merge changes from topic "ownerz" am: 98cd65e17f
am: ac2b7439d9
Change-Id: Ic570b9085f6ffd7a3fd18603b95e2a8ba76a681f
| -rw-r--r-- | PREUPLOAD.cfg | 2 | ||||
| -rwxr-xr-x | tools/aosp/aosp_sha.sh | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index 1f8ab21783ac..07b0ae10fd55 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -14,3 +14,5 @@ api_lint_hook = ${REPO_ROOT}/frameworks/base/tools/apilint/apilint_sha.sh ${PREU strings_lint_hook = ${REPO_ROOT}/frameworks/base/tools/stringslint/stringslint_sha.sh ${PREUPLOAD_COMMIT} hidden_api_txt_hook = ${REPO_ROOT}/frameworks/base/tools/hiddenapi/checksorted_sha.sh ${PREUPLOAD_COMMIT} ${REPO_ROOT} + +owners_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "OWNERS$" diff --git a/tools/aosp/aosp_sha.sh b/tools/aosp/aosp_sha.sh new file mode 100755 index 000000000000..e50c70d0656a --- /dev/null +++ b/tools/aosp/aosp_sha.sh @@ -0,0 +1,24 @@ +#!/bin/bash +LOCAL_DIR="$( dirname "${BASH_SOURCE}" )" + +if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then + # Change appears to be in AOSP + exit 0 +else + # Change appears to be non-AOSP; search for files + count=0 + while read -r file ; do + if (( count == 0 )); then + echo + fi + echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m" + (( count++ )) + done < <(git show --name-only --pretty=format: $1 | grep -- "$2") + if (( count != 0 )); then + echo + echo "If your change contains no confidential details (such as security fixes), please" + echo "upload and merge this change at https://android-review.googlesource.com/." + echo + exit 77 + fi +fi |