summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@google.com> 2018-08-24 16:11:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-08-24 16:11:31 +0000
commit6512b65cc1c394ad8fa41753adc19aadebc0e6ae (patch)
treebe036672061eb6bfa42435b68849b5c41a5ce192 /tools
parent8f7a800095796d2dcf705912c23478b7038d433f (diff)
parentfb7b3732c1bccdef8152f7572d4bf8747414ce13 (diff)
Merge "Upload hook that guides people towards AOSP."
Diffstat (limited to 'tools')
-rwxr-xr-xtools/aosp/aosp_sha.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/aosp/aosp_sha.sh b/tools/aosp/aosp_sha.sh
new file mode 100755
index 000000000000..29bf74c7a8b9
--- /dev/null
+++ b/tools/aosp/aosp_sha.sh
@@ -0,0 +1,18 @@
+#!/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