Skip to content

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

Open
loci-dev wants to merge 3 commits intomainfrom
upstream-PR2375-branch_staehle-user/jstaehle/partial-clone-filters-oss
Open

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

Conversation

@loci-dev
Copy link
Copy Markdown

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

Mirrored from 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:

staehle and others added 2 commits February 1, 2026 16:51
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 upstream-PR2375-branch_staehle-user/jstaehle/partial-clone-filters-oss branch from 1fdf406 to 2c60401 Compare February 1, 2026 18:44
@loci-dev loci-dev force-pushed the main branch 20 times, most recently from 10e213a to 3c9dbbe Compare February 3, 2026 11:10
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from dccca45 to 24496b3 Compare February 21, 2026 07:43
@loci-dev loci-dev force-pushed the main branch 4 times, most recently from f045646 to e746ced Compare February 27, 2026 07:49
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from 3a9c4ae to a28c634 Compare March 10, 2026 07:47
@loci-dev loci-dev force-pushed the main branch 4 times, most recently from 3deba97 to 9b41e5f Compare March 18, 2026 07:49
@loci-dev loci-dev force-pushed the main branch 6 times, most recently from 95ef755 to a9e7940 Compare March 26, 2026 07:51
@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 2 times, most recently from efe2b63 to 51a12b8 Compare April 15, 2026 07:06
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