Summary
vcspull discover (and add) record only the repo: URL for each checkout. They don't detect whether a local clone is shallow, and the config schema has no way to express shallow/depth — so a subsequent vcspull sync performs/keeps a full clone. For workspaces holding 100+ repos, full clones are a significant disk and time cost.
Current behavior (v1.60.1)
discover writes a minimal {repo: <url>} entry per repo (see discover_repos in src/vcspull/cli/discover.py); add does the same (src/vcspull/cli/add.py).
- The per-repo schema
RepoEntryDict exposes only repo and options (src/vcspull/types.py) — there is no shallow/depth key, so shallow state can't be represented at all.
- Neither command runs anything like
git rev-parse --is-shallow-repository, so an existing shallow checkout is silently recorded as if it were full.
The backend already supports it (libvcs v0.41.0)
GitSync(git_shallow=True) → git clone --depth 1 (see GitSync.obtain in src/libvcs/sync/git.py).
Git.clone(depth=…, shallow_since=…, shallow_exclude=…) and Git.fetch(unshallow=…, depth=…) are all exposed (src/libvcs/cmd/git.py).
The capability exists in the backend; vcspull just never plumbs it through to config or sync.
Proposal
- On
discover/add, detect shallow checkouts via git rev-parse --is-shallow-repository and record the result (e.g. shallow: true, or depth: <n>).
- Add a
shallow (bool) and/or depth (int) key to the per-repo schema, plumbed to GitSync(git_shallow=…) on sync.
- Optional
--shallow / --depth N flag on discover/add to force shallow regardless of the on-disk state.
Happy to help test against a large multi-repo config.
Summary
vcspull discover(andadd) record only therepo:URL for each checkout. They don't detect whether a local clone is shallow, and the config schema has no way to express shallow/depth — so a subsequentvcspull syncperforms/keeps a full clone. For workspaces holding 100+ repos, full clones are a significant disk and time cost.Current behavior (v1.60.1)
discoverwrites a minimal{repo: <url>}entry per repo (seediscover_reposinsrc/vcspull/cli/discover.py);adddoes the same (src/vcspull/cli/add.py).RepoEntryDictexposes onlyrepoandoptions(src/vcspull/types.py) — there is noshallow/depthkey, so shallow state can't be represented at all.git rev-parse --is-shallow-repository, so an existing shallow checkout is silently recorded as if it were full.The backend already supports it (libvcs v0.41.0)
GitSync(git_shallow=True)→git clone --depth 1(seeGitSync.obtaininsrc/libvcs/sync/git.py).Git.clone(depth=…, shallow_since=…, shallow_exclude=…)andGit.fetch(unshallow=…, depth=…)are all exposed (src/libvcs/cmd/git.py).The capability exists in the backend; vcspull just never plumbs it through to config or sync.
Proposal
discover/add, detect shallow checkouts viagit rev-parse --is-shallow-repositoryand record the result (e.g.shallow: true, ordepth: <n>).shallow(bool) and/ordepth(int) key to the per-repo schema, plumbed toGitSync(git_shallow=…)onsync.--shallow/--depth Nflag ondiscover/addto force shallow regardless of the on-disk state.Happy to help test against a large multi-repo config.