Skip to content

gitindex: fallback when cat-file filters are unsupported - #1094

Merged
keegancsmith merged 1 commit into
sourcegraph:mainfrom
keegancsmith:k/cat-file-filter-fallback
Jul 24, 2026
Merged

gitindex: fallback when cat-file filters are unsupported#1094
keegancsmith merged 1 commit into
sourcegraph:mainfrom
keegancsmith:k/cat-file-filter-fallback

Conversation

@keegancsmith

Copy link
Copy Markdown
Member

git cat-file --filter was introduced in Git 2.50. On older Git versions the command exits immediately, while the reader only observes EOF and indexing fails instead of using the existing fallback.

Probe the actual cat-file --filter capability before selecting the batch reader, which also accommodates vendor backports, and fall back to go-git when unsupported. The feature-specific reader test now skips when the installed Git lacks this capability.

The source change was verified with a full go test -short ./... run under Git config isolation. The fallback and skip paths passed on Git 2.39.5, and the supported path passed against real Git 2.53.0.

@keegancsmith keegancsmith changed the title fix: fall back when cat-file filters are unsupported gitindex: fallback when cat-file filters are unsupported Jul 24, 2026
@keegancsmith
keegancsmith merged commit 2b2ce2e into sourcegraph:main Jul 24, 2026
7 checks passed
@keegancsmith
keegancsmith deleted the k/cat-file-filter-fallback branch July 24, 2026 09:53
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.

2 participants