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 <vapier@google.com>
Reviewed-by: LaMont Jones <lamontjones@google.com>
diff --git a/man/repo-gitc-init.1 b/man/repo-gitc-init.1
index 2858e73..88136de 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 @@
.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 1cd1e5f..32b3ea1 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 @@
.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 c084b65..1940a31 100755
--- a/repo
+++ b/repo
@@ -149,7 +149,7 @@
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 @@
# 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')