Summary
Follow-up to #550 (shallow clone detection). That work records shallowness as a
boolean shallow: true, because the libvcs sync path can only express
shallow vs. full (git clone --depth 1). Once libvcs can honor an arbitrary
clone depth, add/discover should be able to persist a numeric depth: N and
expose a --depth N flag.
Background
Proposal (once libvcs supports it)
- Add a
depth: int per-repository config key alongside shallow.
- Detect the existing depth on
add/discover (read .git/shallow /
git rev-list --count) and record it.
- Add
--depth N to add/discover; persist depth: N and plumb it through
to GitSync(depth=N) on sync.
- Define precedence between
shallow: true and depth: N (e.g. depth wins;
shallow: true is sugar for depth: 1).
Why
shallow: true covers the common "I don't need history" case, but workspaces
that want a small window of history (e.g. --depth 50) currently can't express
it. This depends on the libvcs change above.
Summary
Follow-up to #550 (shallow clone detection). That work records shallowness as a
boolean
shallow: true, because the libvcs sync path can only expressshallow vs. full (
git clone --depth 1). Once libvcs can honor an arbitraryclone depth,
add/discovershould be able to persist a numericdepth: Nandexpose a
--depth Nflag.Background
shallow: true, mapped togit_shallowon sync.GitSync.obtain()hardcodesdepth=1 if self.git_shallow else None,so a numeric depth cannot be honored on sync today.
Proposal (once libvcs supports it)
depth: intper-repository config key alongsideshallow.add/discover(read.git/shallow/git rev-list --count) and record it.--depth Ntoadd/discover; persistdepth: Nand plumb it throughto
GitSync(depth=N)on sync.shallow: trueanddepth: N(e.g.depthwins;shallow: trueis sugar fordepth: 1).Why
shallow: truecovers the common "I don't need history" case, but workspacesthat want a small window of history (e.g.
--depth 50) currently can't expressit. This depends on the libvcs change above.