Skip to content

UPSTREAM PR #2375: feat: filters and partial cloning: initial support#14

Open
loci-dev wants to merge 3 commits intomainfrom
loci/pr-2375-user-jstaehle-partial-clone-filters-oss
Open

UPSTREAM PR #2375: feat: filters and partial cloning: initial support#14
loci-dev wants to merge 3 commits intomainfrom
loci/pr-2375-user-jstaehle-partial-clone-filters-oss

Conversation

@loci-dev
Copy link
Copy Markdown

@loci-dev loci-dev commented Feb 2, 2026

Note

Source pull request: GitoxideLabs/gitoxide#2375

Resolves #1046

Hi @Byron! I'm Jake Staehle and I work at Roku here with @cesfahani. We've had an internal version of this for our internal tools for quite some time, but I recently updated our gitoxide version to 0.49 and had to refactor this code myself for all the changes since 0.40 -- I would very much rather not do that again, so it's upstreaming time :)

Introduce gix::remote::fetch::ObjectFilter (currently blob filters only) and plumb it through clone/fetch all the way into the fetch protocol, returning a clear error if the remote doesn’t advertise filter capability.

Also persist the partial-clone configuration on clone (remote.<name>.partialclonefilter, remote.<name>.promisor, extensions.partialclone) so the repository is marked as a promisor/partial clone in the same way as Git.

On the CLI/plumbing side, add --filter <spec> to gix clone, and allow fetch arguments to be either refspecs or raw object IDs (treated as additional wants).

Includes tests for filter parsing and for persisting partial-clone settings during clone, as well as a full round-trip test creating a blobless bare clone using gix, creating (using real git) a worktree from that, and then using gix verify that --filter=blob:none is working!

I did create a new repo https://github.com/staehle/gitoxide-testing for that last test to work properly, with a small set of known commits, tags, and blob objects. If you think this is useful, I'd be glad to transfer the repo to you / the GitoxideLabs group!

Let me know what you think! Thanks!

Credit:

@loci-dev loci-dev force-pushed the main branch 4 times, most recently from 167bdd1 to 3deba97 Compare March 15, 2026 07:48
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 0223bcb to bfaee00 Compare March 24, 2026 07:50
staehle and others added 3 commits March 26, 2026 13:26
Introduce `gix::remote::fetch::ObjectFilter` (currently blob filters only)
and plumb it through clone/fetch all the way into the fetch protocol,
returning a clear error if the remote doesn’t advertise `filter` capability.

Also persist the partial-clone configuration on clone
(`remote.<name>.partialclonefilter`, `remote.<name>.promisor`,
`extensions.partialclone`) so the repository is marked as a
promisor/partial clone in the same way as Git.

On the CLI/plumbing side, add `--filter <spec>` to `gix clone`, and allow
fetch arguments to be either refspecs or raw object IDs
(treated as additional wants).

Includes tests for filter parsing and for persisting partial-clone settings during clone.

Creates a blobless bare clone using `gix`,
creates (using real `git`) a worktree from that,
and then using `gix` verify that `--filter=blob:none` is working!

Credit:
 - Original work by Cameron Esfahani <cesfahani@roku.com>
 - Rewritten for modern Gitoxide by Jake Staehle <jstaehle@roku.com>

[Upstream-Status: Appropriate for OSS Release]
…t to avoid the network.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@loci-dev loci-dev force-pushed the loci/pr-2375-user-jstaehle-partial-clone-filters-oss branch from 2c60401 to 28464b5 Compare March 26, 2026 08:14
@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 8b02847 to 1bf0519 Compare April 2, 2026 07:54
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from cdbe120 to 78a7ab5 Compare April 11, 2026 07:49
@loci-dev loci-dev force-pushed the main branch 6 times, most recently from 49231d8 to bc0a777 Compare April 20, 2026 07:18
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.

3 participants