Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: git_cl.py

Issue 2252043002: Gerrit git cl upload: auto-filter patchset titles. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index c03d6103d734c847562babc819440241a82e73c5..6658a2fa05aaf149ac417453e4643cf1e6a9b1f4 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2517,10 +2517,14 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
# https://gerrit-review.googlesource.com/Documentation/user-upload.html
refspec_opts = []
if options.title:
+ if not re.match(r'^[\w ]+$', options.title):
+ options.title = re.sub(r'[^\w ]', '', options.title)
+ print('WARNING: Patchset title may only contain alphanumeric chars '
+ 'and spaces. Cleaned up title:\n%s' % options.title)
+ if not options.force:
+ ask_for_data('Press enter to continue, Ctrl+C to abort')
# Per doc, spaces must be converted to underscores, and Gerrit will do the
# reverse on its side.
- if '_' in options.title:
- print('WARNING: underscores in title will be converted to spaces.')
refspec_opts.append('m=' + options.title.replace(' ', '_'))
if options.send_mail:
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698