Alan Stokes 293096a0cb Use red-on-white rather than red-on-black.
Relying purely on color change is unfriendly to those of us that are
color blind; red on black is a particularly challenging
combination. (Even worse when working from home, since video
compression can lead to washed out colors.)

Changing from light on dark to dark on light should make it fairly
obvious even to those with monochrome vision.

Test: Manual
Change-Id: I79013686038cb4ebea6087b53cece3266bf6ec0b
2020-07-28 18:19:20 +01:00

25 lines
758 B
Bash
Executable File

#!/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;31;47mThe 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 1
fi
fi