Notify if a change auto-CCs more than 100 users
When uploading a large-scale change, many users are automatically CC'ed
on a change. This adds a warning if this is the case and links to a more
appropriate approval for a large-scale change.
Bug: 1194514
Change-Id: Icd336ebdffbccbc9f30a89a33e244a788a768cfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2798963
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
diff --git a/git_cl.py b/git_cl.py
index 829f60f..f20df97 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2333,6 +2333,13 @@
# the initial upload, the CL is private, or auto-CCing has ben disabled.
if not (self.GetIssue() or options.private or options.no_autocc):
cc = self.GetCCList().split(',')
+ if len(cc) > 100:
+ lsc = ('https://chromium.googlesource.com/chromium/src/+/HEAD/docs/'
+ 'process/lsc/lsc_workflow.md')
+ print('WARNING: This will auto-CC %s users.' % len(cc))
+ print('LSC may be more appropriate: %s' % lsc)
+ print('You can also use the --no-autocc flag to disable auto-CC.')
+ confirm_or_exit(action='continue')
# Add cc's from the --cc flag.
if options.cc:
cc.extend(options.cc)