summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2023-01-05 11:34:19 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-05 17:53:13 +0000
commitecb87bfcbaca7cb33e0fdcfa27e9745a59676e80 (patch)
tree73c79529e1ef6eaf3419acc986bb6b5205702555
parenta09b792e6a159d7d21b8e64f07a056ba08f8014d (diff)
downloadvboot-ecb87bfcbaca7cb33e0fdcfa27e9745a59676e80.tar.gz
Add PRESUBMIT.py
Add PRESUBMIT.py to prevent people from uploading CLs using `git cl`. BUG=none TEST=`git cl upload` failed BRANCH=none Change-Id: I1906614093c6135dff1279393e3d79172f41a3c0 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4133838 Commit-Queue: Yidi Lin <yidilin@chromium.org> Reviewed-by: Yidi Lin <yidilin@chromium.org>
-rw-r--r--PRESUBMIT.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
new file mode 100644
index 00000000..64abb3cf
--- /dev/null
+++ b/PRESUBMIT.py
@@ -0,0 +1,17 @@
+# Copyright 2023 The ChromiumOS Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""Hook to stop people from running `git cl`."""
+
+import sys
+
+USE_PYTHON3 = True
+
+
+def CheckChangeOnUpload(_input_api, _output_api):
+ print(
+ "ERROR: CrOS repos use `repo upload`, not `git cl upload`.\n"
+ "See https://chromium.googlesource.com/chromiumos/docs/+/HEAD/contributing.md#upload-changes.",
+ file=sys.stderr,
+ )
+ sys.exit(1)