Skip to content

add/discover: support numeric depth: N (follow-up to #550) #552

@tony

Description

@tony

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)

  1. Add a depth: int per-repository config key alongside shallow.
  2. Detect the existing depth on add/discover (read .git/shallow /
    git rev-list --count) and record it.
  3. Add --depth N to add/discover; persist depth: N and plumb it through
    to GitSync(depth=N) on sync.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions