diff options
| -rw-r--r-- | docs/internal-fs-layout.md | 2 | ||||
| -rw-r--r-- | manifest_xml.py | 4 | ||||
| -rw-r--r-- | project.py | 5 | ||||
| -rwxr-xr-x | repo | 7 | ||||
| -rw-r--r-- | subcmds/init.py | 9 |
5 files changed, 24 insertions, 3 deletions
diff --git a/docs/internal-fs-layout.md b/docs/internal-fs-layout.md index af6a4523..0e830510 100644 --- a/docs/internal-fs-layout.md +++ b/docs/internal-fs-layout.md | |||
| @@ -163,6 +163,7 @@ User controlled settings are initialized when running `repo init`. | |||
| 163 | | repo.clonefilter | `--clone-filter` | Filter setting when using [partial git clones] | | 163 | | repo.clonefilter | `--clone-filter` | Filter setting when using [partial git clones] | |
| 164 | | repo.depth | `--depth` | Create shallow checkouts when cloning | | 164 | | repo.depth | `--depth` | Create shallow checkouts when cloning | |
| 165 | | repo.dissociate | `--dissociate` | Dissociate from any reference/mirrors after initial clone | | 165 | | repo.dissociate | `--dissociate` | Dissociate from any reference/mirrors after initial clone | |
| 166 | | repo.git-lfs | `--git-lfs` | Enable [Git LFS] support | | ||
| 166 | | repo.mirror | `--mirror` | Checkout is a repo mirror | | 167 | | repo.mirror | `--mirror` | Checkout is a repo mirror | |
| 167 | | repo.partialclone | `--partial-clone` | Create [partial git clones] | | 168 | | repo.partialclone | `--partial-clone` | Create [partial git clones] | |
| 168 | | repo.partialcloneexclude | `--partial-clone-exclude` | Comma-delimited list of project names (not paths) to exclude while using [partial git clones] | | 169 | | repo.partialcloneexclude | `--partial-clone-exclude` | Comma-delimited list of project names (not paths) to exclude while using [partial git clones] | |
| @@ -254,6 +255,7 @@ Repo will create & maintain a few files in the user's home directory. | |||
| 254 | 255 | ||
| 255 | 256 | ||
| 256 | [git-config]: https://git-scm.com/docs/git-config | 257 | [git-config]: https://git-scm.com/docs/git-config |
| 258 | [Git LFS]: https://git-lfs.github.com/ | ||
| 257 | [git worktree]: https://git-scm.com/docs/git-worktree | 259 | [git worktree]: https://git-scm.com/docs/git-worktree |
| 258 | [gitsubmodules]: https://git-scm.com/docs/gitsubmodules | 260 | [gitsubmodules]: https://git-scm.com/docs/gitsubmodules |
| 259 | [manifest-format.md]: ./manifest-format.md | 261 | [manifest-format.md]: ./manifest-format.md |
diff --git a/manifest_xml.py b/manifest_xml.py index 68ead53c..daf85d30 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -666,6 +666,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
| 666 | def HasSubmodules(self): | 666 | def HasSubmodules(self): |
| 667 | return self.manifestProject.config.GetBoolean('repo.submodules') | 667 | return self.manifestProject.config.GetBoolean('repo.submodules') |
| 668 | 668 | ||
| 669 | @property | ||
| 670 | def EnableGitLfs(self): | ||
| 671 | return self.manifestProject.config.GetBoolean('repo.git-lfs') | ||
| 672 | |||
| 669 | def GetDefaultGroupsStr(self): | 673 | def GetDefaultGroupsStr(self): |
| 670 | """Returns the default group string for the platform.""" | 674 | """Returns the default group string for the platform.""" |
| 671 | return 'default,platform-' + platform.system().lower() | 675 | return 'default,platform-' + platform.system().lower() |
| @@ -2533,8 +2533,9 @@ class Project(object): | |||
| 2533 | for key in ['user.name', 'user.email']: | 2533 | for key in ['user.name', 'user.email']: |
| 2534 | if m.Has(key, include_defaults=False): | 2534 | if m.Has(key, include_defaults=False): |
| 2535 | self.config.SetString(key, m.GetString(key)) | 2535 | self.config.SetString(key, m.GetString(key)) |
| 2536 | self.config.SetString('filter.lfs.smudge', 'git-lfs smudge --skip -- %f') | 2536 | if not self.manifest.EnableGitLfs: |
| 2537 | self.config.SetString('filter.lfs.process', 'git-lfs filter-process --skip') | 2537 | self.config.SetString('filter.lfs.smudge', 'git-lfs smudge --skip -- %f') |
| 2538 | self.config.SetString('filter.lfs.process', 'git-lfs filter-process --skip') | ||
| 2538 | self.config.SetBoolean('core.bare', True if self.manifest.IsMirror else None) | 2539 | self.config.SetBoolean('core.bare', True if self.manifest.IsMirror else None) |
| 2539 | except Exception: | 2540 | except Exception: |
| 2540 | if init_obj_dir and os.path.exists(self.objdir): | 2541 | if init_obj_dir and os.path.exists(self.objdir): |
| @@ -149,7 +149,7 @@ if not REPO_REV: | |||
| 149 | BUG_URL = 'https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue' | 149 | BUG_URL = 'https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue' |
| 150 | 150 | ||
| 151 | # increment this whenever we make important changes to this script | 151 | # increment this whenever we make important changes to this script |
| 152 | VERSION = (2, 17) | 152 | VERSION = (2, 21) |
| 153 | 153 | ||
| 154 | # increment this if the MAINTAINER_KEYS block is modified | 154 | # increment this if the MAINTAINER_KEYS block is modified |
| 155 | KEYRING_VERSION = (2, 3) | 155 | KEYRING_VERSION = (2, 3) |
| @@ -382,6 +382,11 @@ def InitParser(parser, gitc_init=False): | |||
| 382 | group.add_option('--no-clone-bundle', | 382 | group.add_option('--no-clone-bundle', |
| 383 | dest='clone_bundle', action='store_false', | 383 | dest='clone_bundle', action='store_false', |
| 384 | help='disable use of /clone.bundle on HTTP/HTTPS (default if --partial-clone)') | 384 | help='disable use of /clone.bundle on HTTP/HTTPS (default if --partial-clone)') |
| 385 | group.add_option('--git-lfs', action='store_true', | ||
| 386 | help='enable Git LFS support') | ||
| 387 | group.add_option('--no-git-lfs', | ||
| 388 | dest='git_lfs', action='store_false', | ||
| 389 | help='disable Git LFS support') | ||
| 385 | 390 | ||
| 386 | # Tool. | 391 | # Tool. |
| 387 | group = parser.add_option_group('repo Version options') | 392 | group = parser.add_option_group('repo Version options') |
diff --git a/subcmds/init.py b/subcmds/init.py index b0db76a4..32c85f79 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -291,6 +291,15 @@ to update the working directory files. | |||
| 291 | if opt.submodules: | 291 | if opt.submodules: |
| 292 | m.config.SetBoolean('repo.submodules', opt.submodules) | 292 | m.config.SetBoolean('repo.submodules', opt.submodules) |
| 293 | 293 | ||
| 294 | if opt.git_lfs is not None: | ||
| 295 | if opt.git_lfs: | ||
| 296 | git_require((2, 17, 0), fail=True, msg='Git LFS support') | ||
| 297 | |||
| 298 | m.config.SetBoolean('repo.git-lfs', opt.git_lfs) | ||
| 299 | if not is_new: | ||
| 300 | print('warning: Changing --git-lfs settings will only affect new project checkouts.\n' | ||
| 301 | ' Existing projects will require manual updates.\n', file=sys.stderr) | ||
| 302 | |||
| 294 | if opt.use_superproject is not None: | 303 | if opt.use_superproject is not None: |
| 295 | m.config.SetBoolean('repo.superproject', opt.use_superproject) | 304 | m.config.SetBoolean('repo.superproject', opt.use_superproject) |
| 296 | 305 | ||
