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/overview.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/overview.py')
-rw-r--r-- | subcmds/overview.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/subcmds/overview.py b/subcmds/overview.py index 004a847c..4f62f94f 100644 --- a/subcmds/overview.py +++ b/subcmds/overview.py | |||
@@ -12,6 +12,8 @@ | |||
12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
13 | # limitations under the License. | 13 | # limitations under the License. |
14 | 14 | ||
15 | import optparse | ||
16 | |||
15 | from color import Coloring | 17 | from color import Coloring |
16 | from command import PagedCommand | 18 | from command import PagedCommand |
17 | 19 | ||
@@ -26,15 +28,19 @@ class Overview(PagedCommand): | |||
26 | The '%prog' command is used to display an overview of the projects branches, | 28 | The '%prog' command is used to display an overview of the projects branches, |
27 | and list any local commits that have not yet been merged into the project. | 29 | and list any local commits that have not yet been merged into the project. |
28 | 30 | ||
29 | The -b/--current-branch option can be used to restrict the output to only | 31 | The -c/--current-branch option can be used to restrict the output to only |
30 | branches currently checked out in each project. By default, all branches | 32 | branches currently checked out in each project. By default, all branches |
31 | are displayed. | 33 | are displayed. |
32 | """ | 34 | """ |
33 | 35 | ||
34 | def _Options(self, p): | 36 | def _Options(self, p): |
35 | p.add_option('-b', '--current-branch', | 37 | p.add_option('-c', '--current-branch', |
36 | dest="current_branch", action="store_true", | 38 | dest="current_branch", action="store_true", |
37 | help="Consider only checked out branches") | 39 | help="Consider only checked out branches") |
40 | # Turn this into a warning & remove this someday. | ||
41 | p.add_option('-b', | ||
42 | dest='current_branch', action='store_true', | ||
43 | help=optparse.SUPPRESS_HELP) | ||
38 | 44 | ||
39 | def Execute(self, opt, args): | 45 | def Execute(self, opt, args): |
40 | all_branches = [] | 46 | all_branches = [] |