Expand description
git cat-file --batch[-check] long-running subprocess wrappers.
Both flavors keep one git subprocess alive across many queries, which
is critical for scanners that need to inspect thousands of OIDs (one
fork per object would dominate runtime). Send <oid>\n on stdin,
parse <oid> <type> <size>\n (or <oid> missing\n) from stdout.
--batch additionally streams <size> bytes of content + a trailing
newline after the header.
See git-cat-file(1) § “BATCH OUTPUT”.
Structs§
- Blob
Content - Full response from
cat-file --batch: a header plus exactlysizebytes of content (only present when the header isCatFileHeader::Found). - CatFile
Batch git cat-file --batch— header + content mode. Use this once you’ve narrowed candidates withCatFileBatchCheck(typically by size).- CatFile
Batch Check git cat-file --batch-check— header-only mode. Use this to decide whether to spend the I/O on reading a blob’s content (e.g. filter to blobs ≤ MAX_POINTER_SIZE before paying the read cost).
Enums§
- CatFile
Header - One header response from
cat-file --batch[-check].