From 7ff80afdf66e8a00745300c0375d98f2ba8887b5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 19 Feb 2020 03:00:26 -0500 Subject: upload: add a --hashtag-branch option akin to -t This will automatically add the current local branch name as a hashtag. Bug: https://crbug.com/gerrit/10477 Change-Id: I888f8be8419c801f2d98b7a2ad2486799e94f32c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255893 Tested-by: Mike Frysinger Reviewed-by: Mike Frysinger --- subcmds/upload.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'subcmds/upload.py') diff --git a/subcmds/upload.py b/subcmds/upload.py index 856c7fb9..ef6d0242 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -149,6 +149,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/ p.add_option('--hashtag', '--ht', dest='hashtags', action='append', default=[], help='Add hashtags (comma delimited) to the review.') + p.add_option('--hashtag-branch', '--htb', + action='store_true', + help='Add local branch name as a hashtag.') p.add_option('--re', '--reviewers', type='string', action='append', dest='reviewers', help='Request reviews from these people.') @@ -420,6 +423,8 @@ Gerrit Code Review: https://www.gerritcodereview.com/ hashtags = set(_ExpandHashtag(branch.project.config.GetString(key))) for tag in opt.hashtags: hashtags.update(_ExpandHashtag(tag)) + if opt.hashtag_branch: + hashtags.add(branch.name) destination = opt.dest_branch or branch.project.dest_branch -- cgit v1.2.3-54-g00ecf