summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSeth Moore <sethmo@google.com>2021-05-24 13:43:35 -0700
committerSeth Moore <sethmo@google.com>2021-05-24 14:15:36 -0700
commit627b9ca3b706d6205216fd7e3726cbed45300a1a (patch)
treea9ce77fb7c9a68dc8465dffb8602fcd10e1c54b3 /tools
parent5fcdcebfd24a303409d25d29ec1093cc09091307 (diff)
Check for Ignore-AOSP-First commit tag
If the Ignore-AOSP-First tag is in a commit message, it means the committer is intentionally bypassing the AOSP source of truth. Check for this tag in the AOSP-first presubmit hook so that devs don't have to turn off hooks to get past the AOSP-first policy in exceptional cases. Bug: 189139990 Change-Id: I18231b93d7f213c13ace0a0af24bb20a394cc50f Test: Manual testing with various commit messages
Diffstat (limited to 'tools')
-rwxr-xr-xtools/aosp/aosp_sha.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/aosp/aosp_sha.sh b/tools/aosp/aosp_sha.sh
index 99aaa3c4d6e5..81d35efaf29f 100755
--- a/tools/aosp/aosp_sha.sh
+++ b/tools/aosp/aosp_sha.sh
@@ -4,6 +4,9 @@ LOCAL_DIR="$( dirname "${BASH_SOURCE}" )"
if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then
# Change appears to be in AOSP
exit 0
+elif git log -n 1 --format='%B' $1 | grep -q -E "^Ignore-AOSP-First: .+" ; then
+ # Change is explicitly marked as ok to skip AOSP
+ exit 0
else
# Change appears to be non-AOSP; search for files
count=0