Skip to content

gitindex: fall back when cat-file filter is unsupported#1037

Draft
keegancsmith wants to merge 1 commit intomainfrom
k/cat-file-fallback
Draft

gitindex: fall back when cat-file filter is unsupported#1037
keegancsmith wants to merge 1 commit intomainfrom
k/cat-file-fallback

Conversation

@keegancsmith
Copy link
Copy Markdown
Member

Older Git versions can reject cat-file --batch with --filter, causing the process to exit before yielding any blobs. We were treating the closed stdout pipe as EOF, which made indexing silently produce empty shards.

Capture cat-file stderr and wait status so startup failures surface as real errors. If cat-file fails before any blobs are processed, fall back to the existing go-git path so indexing still succeeds on older Git installations.

Keep mid-stream cat-file failures fatal instead of falling back once some blobs have already been indexed. That avoids mixing two readers and writing partial or inconsistent shards.

Older Git versions can reject cat-file --batch with --filter, causing
the process to exit before yielding any blobs. We were treating the
closed stdout pipe as EOF, which made indexing silently produce empty
shards.

Capture cat-file stderr and wait status so startup failures surface as
real errors. If cat-file fails before any blobs are processed, fall back
to the existing go-git path so indexing still succeeds on older Git
installations.

Keep mid-stream cat-file failures fatal instead of falling back once
some blobs have already been indexed. That avoids mixing two readers and
writing partial or inconsistent shards.
@keegancsmith
Copy link
Copy Markdown
Member Author

Note: I haven't tested this code yet, so just opening as a draft PR for now.

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.

1 participant