ANDROID: drm_hwcomposer: Add pre-push hook
Add a pre-push hook to detect commits that are prefixed with ANDROID:,
and prevent them from being pushed to a potentially public remote.
Add a script to install the pre-push hook.
Add a PREUPLOAD hook that checks that the pre-push hook has been
installed. Since this hook needs to be installed manually, the PREUPLOAD
hook will remind contributors to install the next time they attempt to
`repo upload`.
Test: `git push -n $gitlab-remote`
Test: `git push -n aosp`
Test: repo upload
Bug: 371583224
Change-Id: I4a07c2938417e5983b66ce67e375c8fced5a4007
diff --git a/hooks/install-hooks.sh b/hooks/install-hooks.sh
new file mode 100755
index 0000000..d19a3c8
--- /dev/null
+++ b/hooks/install-hooks.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Install hooks.
+git config --add hookcmd.check-non-public-commits.command hooks/check-non-public-commits
+git config --add hook.pre-push.command check-non-public-commits
\ No newline at end of file