From 39cb17f7a31d8f6d8b6bddfe4406cf2ff4ed31a6 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 18 Aug 2022 07:28:42 -0400 Subject: [PATCH] init: use --current-branch by default People rarely care about having all manifest branches locally. Change the default to only pull down the selected branch. If people want other branches, the -b option will fetch it automatically, or people can use --no-current-branch. This only applies to the manifest project syncing, not the rest of the projects that are in the checkout. Bug: https://crbug.com/gerrit/16194 Change-Id: Ia9e7e2f23b8028d82772db72dcc7d6c32260be79 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343434 Tested-by: Mike Frysinger Reviewed-by: LaMont Jones --- man/repo-gitc-init.1 | 3 ++- man/repo-init.1 | 3 ++- repo | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/man/repo-gitc-init.1 b/man/repo-gitc-init.1 index 2858e735..88136de6 100644 --- a/man/repo-gitc-init.1 +++ b/man/repo-gitc-init.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH REPO "1" "July 2022" "repo gitc-init" "Repo Manual" +.TH REPO "1" "August 2022" "repo gitc-init" "Repo Manual" .SH NAME repo \- repo gitc-init - manual page for repo gitc-init .SH SYNOPSIS @@ -49,6 +49,7 @@ create a git checkout of the manifest repo .TP \fB\-\-current\-branch\fR fetch only current manifest branch from server +(default) .TP \fB\-\-no\-current\-branch\fR fetch all manifest branches from server diff --git a/man/repo-init.1 b/man/repo-init.1 index 1cd1e5f1..32b3ea1b 100644 --- a/man/repo-init.1 +++ b/man/repo-init.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH REPO "1" "July 2022" "repo init" "Repo Manual" +.TH REPO "1" "August 2022" "repo init" "Repo Manual" .SH NAME repo \- repo init - manual page for repo init .SH SYNOPSIS @@ -49,6 +49,7 @@ create a git checkout of the manifest repo .TP \fB\-c\fR, \fB\-\-current\-branch\fR fetch only current manifest branch from server +(default) .TP \fB\-\-no\-current\-branch\fR fetch all manifest branches from server diff --git a/repo b/repo index c084b654..1940a319 100755 --- a/repo +++ b/repo @@ -149,7 +149,7 @@ if not REPO_REV: BUG_URL = 'https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue' # increment this whenever we make important changes to this script -VERSION = (2, 21) +VERSION = (2, 29) # increment this if the MAINTAINER_KEYS block is modified KEYRING_VERSION = (2, 3) @@ -325,9 +325,9 @@ def InitParser(parser, gitc_init=False): # want -c, so try to satisfy both as best we can. if not gitc_init: cbr_opts += ['-c'] - group.add_option(*cbr_opts, + group.add_option(*cbr_opts, default=True, dest='current_branch_only', action='store_true', - help='fetch only current manifest branch from server') + help='fetch only current manifest branch from server (default)') group.add_option('--no-current-branch', dest='current_branch_only', action='store_false', help='fetch all manifest branches from server')