diff options
| author | Mike Frysinger <vapier@google.com> | 2021-04-08 23:04:36 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2021-04-09 15:58:45 +0000 |
| commit | a1051d8baa15d785dd9d6b55caa3cd2e8b2e0fc8 (patch) | |
| tree | 75c13563c543e2c1038bd3738d80e33ffd30f9ef | |
| parent | 65af2602b58bb2470972c105aa16b30696ceeb49 (diff) | |
| download | git-repo-a1051d8baa15d785dd9d6b55caa3cd2e8b2e0fc8.tar.gz | |
init: organize command line options a bit
We've grown a lot of options in here and it's hard to make sense of
them. Add more groups to try and make it easier to pick things out.
Change-Id: I6b9dc0e83f96137f974baf82d3fb86992b857bd2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/302803
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
| -rwxr-xr-x | repo | 46 |
1 files changed, 28 insertions, 18 deletions
| @@ -298,6 +298,20 @@ def InitParser(parser, gitc_init=False): | |||
| 298 | help='manifest branch or revision (use HEAD for default)') | 298 | help='manifest branch or revision (use HEAD for default)') |
| 299 | group.add_option('-m', '--manifest-name', | 299 | group.add_option('-m', '--manifest-name', |
| 300 | help='initial manifest file', metavar='NAME.xml') | 300 | help='initial manifest file', metavar='NAME.xml') |
| 301 | group.add_option('-g', '--groups', default='default', | ||
| 302 | help='restrict manifest projects to ones with specified ' | ||
| 303 | 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]', | ||
| 304 | metavar='GROUP') | ||
| 305 | group.add_option('-p', '--platform', default='auto', | ||
| 306 | help='restrict manifest projects to ones with a specified ' | ||
| 307 | 'platform group [auto|all|none|linux|darwin|...]', | ||
| 308 | metavar='PLATFORM') | ||
| 309 | group.add_option('--submodules', action='store_true', | ||
| 310 | help='sync any submodules associated with the manifest repo') | ||
| 311 | |||
| 312 | # Options that only affect manifest project, and not any of the projects | ||
| 313 | # specified in the manifest itself. | ||
| 314 | group = parser.add_option_group('Manifest (only) checkout options') | ||
| 301 | cbr_opts = ['--current-branch'] | 315 | cbr_opts = ['--current-branch'] |
| 302 | # The gitc-init subcommand allocates -c itself, but a lot of init users | 316 | # The gitc-init subcommand allocates -c itself, but a lot of init users |
| 303 | # want -c, so try to satisfy both as best we can. | 317 | # want -c, so try to satisfy both as best we can. |
| @@ -306,9 +320,23 @@ def InitParser(parser, gitc_init=False): | |||
| 306 | group.add_option(*cbr_opts, | 320 | group.add_option(*cbr_opts, |
| 307 | dest='current_branch_only', action='store_true', | 321 | dest='current_branch_only', action='store_true', |
| 308 | help='fetch only current manifest branch from server') | 322 | help='fetch only current manifest branch from server') |
| 323 | group.add_option('--no-tags', | ||
| 324 | dest='tags', default=True, action='store_false', | ||
| 325 | help="don't fetch tags in the manifest") | ||
| 326 | |||
| 327 | # These are fundamentally different ways of structuring the checkout. | ||
| 328 | group = parser.add_option_group('Checkout modes') | ||
| 309 | group.add_option('--mirror', action='store_true', | 329 | group.add_option('--mirror', action='store_true', |
| 310 | help='create a replica of the remote repositories ' | 330 | help='create a replica of the remote repositories ' |
| 311 | 'rather than a client working directory') | 331 | 'rather than a client working directory') |
| 332 | group.add_option('--archive', action='store_true', | ||
| 333 | help='checkout an archive instead of a git repository for ' | ||
| 334 | 'each project. See git archive.') | ||
| 335 | group.add_option('--worktree', action='store_true', | ||
| 336 | help='use git-worktree to manage projects') | ||
| 337 | |||
| 338 | # These are fundamentally different ways of structuring the checkout. | ||
| 339 | group = parser.add_option_group('Project checkout optimizations') | ||
| 312 | group.add_option('--reference', | 340 | group.add_option('--reference', |
| 313 | help='location of mirror directory', metavar='DIR') | 341 | help='location of mirror directory', metavar='DIR') |
| 314 | group.add_option('--dissociate', action='store_true', | 342 | group.add_option('--dissociate', action='store_true', |
| @@ -325,35 +353,17 @@ def InitParser(parser, gitc_init=False): | |||
| 325 | group.add_option('--clone-filter', action='store', default='blob:none', | 353 | group.add_option('--clone-filter', action='store', default='blob:none', |
| 326 | help='filter for use with --partial-clone ' | 354 | help='filter for use with --partial-clone ' |
| 327 | '[default: %default]') | 355 | '[default: %default]') |
| 328 | group.add_option('--worktree', action='store_true', | ||
| 329 | help='use git-worktree to manage projects') | ||
| 330 | group.add_option('--archive', action='store_true', | ||
| 331 | help='checkout an archive instead of a git repository for ' | ||
| 332 | 'each project. See git archive.') | ||
| 333 | group.add_option('--submodules', action='store_true', | ||
| 334 | help='sync any submodules associated with the manifest repo') | ||
| 335 | group.add_option('--use-superproject', action='store_true', default=None, | 356 | group.add_option('--use-superproject', action='store_true', default=None, |
| 336 | help='use the manifest superproject to sync projects') | 357 | help='use the manifest superproject to sync projects') |
| 337 | group.add_option('--no-use-superproject', action='store_false', | 358 | group.add_option('--no-use-superproject', action='store_false', |
| 338 | dest='use_superproject', | 359 | dest='use_superproject', |
| 339 | help='disable use of manifest superprojects') | 360 | help='disable use of manifest superprojects') |
| 340 | group.add_option('-g', '--groups', default='default', | ||
| 341 | help='restrict manifest projects to ones with specified ' | ||
| 342 | 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]', | ||
| 343 | metavar='GROUP') | ||
| 344 | group.add_option('-p', '--platform', default='auto', | ||
| 345 | help='restrict manifest projects to ones with a specified ' | ||
| 346 | 'platform group [auto|all|none|linux|darwin|...]', | ||
| 347 | metavar='PLATFORM') | ||
| 348 | group.add_option('--clone-bundle', action='store_true', | 361 | group.add_option('--clone-bundle', action='store_true', |
| 349 | help='enable use of /clone.bundle on HTTP/HTTPS ' | 362 | help='enable use of /clone.bundle on HTTP/HTTPS ' |
| 350 | '(default if not --partial-clone)') | 363 | '(default if not --partial-clone)') |
| 351 | group.add_option('--no-clone-bundle', | 364 | group.add_option('--no-clone-bundle', |
| 352 | dest='clone_bundle', action='store_false', | 365 | dest='clone_bundle', action='store_false', |
| 353 | help='disable use of /clone.bundle on HTTP/HTTPS (default if --partial-clone)') | 366 | help='disable use of /clone.bundle on HTTP/HTTPS (default if --partial-clone)') |
| 354 | group.add_option('--no-tags', | ||
| 355 | dest='tags', default=True, action='store_false', | ||
| 356 | help="don't fetch tags in the manifest") | ||
| 357 | 367 | ||
| 358 | # Tool. | 368 | # Tool. |
| 359 | group = parser.add_option_group('repo Version options') | 369 | group = parser.add_option_group('repo Version options') |
