diff options
author | Mike Frysinger <vapier@google.com> | 2021-05-03 00:51:52 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2021-05-03 16:57:23 +0000 |
commit | b8e09ea1d6e8051697da52db1291e8267844e206 (patch) | |
tree | d708bf68be5f7d5f644290b4b5f4f2797d30568c /subcmds/upload.py | |
parent | feb28914bd17aacc2d251516e504a33f991f86c4 (diff) | |
download | git-repo-b8e09ea1d6e8051697da52db1291e8267844e206.tar.gz |
harmonize --current-branch short option across subcommands
We're inconsistent with the short option for this flag:
* gitc-init: <none as -c is already used>
* info: -b
* init: -c
* overview: -b
* sync: -c
* upload: --cbr
Since info & overview are not as heavily used as the others, switch
them from -b to -c. We leave -b in as a hidden alias for now.
Similarly, switch upload from --cbr to just -c. A lot of people
use --cbr, so we leave this as a hidden alias for now too.
Ideally gitc-init wouldn't use -c, but that ship has sailed, and
we're more likely to deprecate gitc entirely at this point.
This provides a consistent set of options across subcommands.
Bug: https://crbug.com/gerrit/12401
Change-Id: Iec249729223866fe1ea0ebabed12ca851cc38b35
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/304902
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 0dd0b7da..57434b18 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | import copy | 15 | import copy |
16 | import functools | 16 | import functools |
17 | import optparse | ||
17 | import re | 18 | import re |
18 | import sys | 19 | import sys |
19 | 20 | ||
@@ -170,9 +171,13 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
170 | p.add_option('--br', '--branch', | 171 | p.add_option('--br', '--branch', |
171 | type='string', action='store', dest='branch', | 172 | type='string', action='store', dest='branch', |
172 | help='(Local) branch to upload.') | 173 | help='(Local) branch to upload.') |
173 | p.add_option('--cbr', '--current-branch', | 174 | p.add_option('-c', '--current-branch', |
174 | dest='current_branch', action='store_true', | 175 | dest='current_branch', action='store_true', |
175 | help='Upload current git branch.') | 176 | help='Upload current git branch.') |
177 | # Turn this into a warning & remove this someday. | ||
178 | p.add_option('--cbr', | ||
179 | dest='current_branch', action='store_true', | ||
180 | help=optparse.SUPPRESS_HELP) | ||
176 | p.add_option('--ne', '--no-emails', | 181 | p.add_option('--ne', '--no-emails', |
177 | action='store_false', dest='notify', default=True, | 182 | action='store_false', dest='notify', default=True, |
178 | help='If specified, do not send emails on upload.') | 183 | help='If specified, do not send emails on upload.') |