From cebfb4e614a8878297306d943663e765a8f5e251 Mon Sep 17 00:00:00 2001 From: Mario Bianucci Date: Wed, 22 Jul 2020 23:08:16 +0000 Subject: [PATCH] Adding --skip-title option to git cl upload Adding an optional --skip-title argument to git cl upload to automatically use the latest commit message as the patch title, without requiring the user to hit "enter" to accept. Change-Id: I0e37b68c809d907a4f980f2be59865e14b1a2db2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2297803 Reviewed-by: Edward Lesmes Commit-Queue: Mario Bianucci --- git_cl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index d951c5a47a..b30cdb3605 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1373,7 +1373,7 @@ class Changelist(object): # Use the subject of the last commit as title by default. title = RunGit(['show', '-s', '--format=%s', 'HEAD']).strip() - if options.force: + if options.force or options.skip_title: return title user_title = gclient_utils.AskForData('Title for patchset [%s]: ' % title) return user_title or title @@ -3989,6 +3989,10 @@ def CMDupload(parser, args): help='file which contains message for patchset') parser.add_option('--title', '-t', dest='title', help='title for patchset') + parser.add_option('-T', '--skip-title', action='store_true', + dest='skip_title', + help='Use the most recent commit message as the title of ' + 'the patchset') parser.add_option('-r', '--reviewers', action='append', default=[], help='reviewer email addresses') @@ -4096,6 +4100,9 @@ def CMDupload(parser, args): parser.error('Only one of --use-commit-queue, --cq-dry-run, or ' '--retry-failed is allowed.') + if options.skip_title and options.title: + parser.error('Only one of --title and --skip-title allowed.') + if options.use_commit_queue: options.send_mail = True