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

Commit 0a9c7319 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Upload hook that guides people towards AOSP.

The canonical location of certain parts of the source tree live in
AOSP, and should not be changed internally to avoid merge conflicts.

This initially starts with "OWNERS" files, but the hook can easily
be repeated to match any files based on file path regexes.

Bug: 113136846
Test: manual
Change-Id: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
Merged-In: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
parent 98627fa4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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$"

tools/aosp/aosp_sha.sh

0 → 100755
+18 −0
Original line number Diff line number Diff line
#!/bin/bash
LOCAL_DIR="$( dirname ${BASH_SOURCE} )"

if git branch -vv | grep "^*" | grep "\[aosp/master" > /dev/null; then
    # Change appears to be in AOSP
    exit 0
else
    # Change appears to be non-AOSP; search for files
    git show --name-only --pretty=format: $1 | grep $2 | while read file; do
        echo
        echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m"
        echo
        echo "If your change contains no confidential details, please upload and merge"
        echo "this change at https://android-review.googlesource.com/."
        echo
        exit 77
    done
fi