Skip to content

Add filtered fetch and explicit object hydration - #9

Open
thiagomajesk wants to merge 1 commit into
blindmansion:mainfrom
thiagomajesk:gitit-partial-fetch
Open

thiagomajesk wants to merge 1 commit into
blindmansion:mainfrom
thiagomajesk:gitit-partial-fetch

Conversation

@thiagomajesk

Copy link
Copy Markdown

Closes #8.

Adds support for downloading commits and trees without blob contents, then fetching only the objects an application needs. This reduces transfers for applications that work with a subset of a repository.

  • Support --filter=blob:none for fetch and clone, including shallow fetches.
  • Persist the promisor remote and filter configuration for subsequent fetches.
  • Add fetchObjects() to just-git/repo for explicitly retrieving missing objects in batches.
  • Reuse existing transports, credentials, network policies and fetch hooks.
  • Support fetch --no-tags and the remote’s saved tag configuration.

Object reads never trigger implicit downloads. Hydration skips existing objects and duplicates without changing refs, FETCH_HEAD or shallow boundaries.

Filtered clones require --no-checkout or --bare. Only blob:none is supported, and Smart HTTP remotes must advertise the filter capability. General checkout, diff and merge operations on partial repositories are outside this change; pull, GC and repack reject partial repositories before modifying them.

Includes a native Git Smart HTTP integration test covering selective hydration, subsequent filtered fetches, configuration preservation, unsupported filters and pushing changes while preserving files whose blobs were never downloaded. Documentation includes usage examples and limitations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to partial clones

1 participant