summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)