Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3d78421 authored by Seth Moore's avatar Seth Moore
Browse files

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
Merged-In: I18231b93d7f213c13ace0a0af24bb20a394cc50f
Test: Manual testing with various commit messages
parent 76660552
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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.