openai/git
patches / integration status

$ git branch --contains <commit>

git: notes on large repositories

OpenAI's work on Git for large repositories

From
openai scm
Repository
openai/git
Upstream
git/git
Updated
24 Aug 2026
openai/git and git/git
  1. 6cooking here
  2. 19merged to openai/git
  3. 3git/git seen
  4. 0git/git next
  5. 3git/git master

master3 threads

Already merged into upstream Git's master branch.

[01]

stash: avoid sparse-index expansion for in-cone paths

master
From
Ted Nyman
Date
20 Jul 2026
Patches
2

A path-limited git stash expanded the full sparse index even when every requested path was already inside the sparse checkout.

Keep the index sparse when possible, expand it when a pathspec needs the full index, and fix a related out-of-bounds read. Paths outside the sparse-checkout cone retain their existing behavior.

18.87 s four index expansions

0.06 s zero index expansions

[02]

pack-objects: use bitmaps and delta islands with path-walk

master
From
Taylor Blau
Date
21 Jun 2026
Patches
4

Path-based pack traversal could not use reachability bitmaps or delta islands.

Enable both existing pack optimizations during path-walk by collecting commit and tree information from its existing callback. Fall back to ordinary traversal when a bitmap cannot satisfy the request.

[03]

http: make concurrent packfile-URI downloads safe

master
From
Ted Nyman
Date
26 Jul 2026
Patches
6

Concurrent pack downloads could corrupt a partial pack, race cleanup, or mishandle a completed resume.

Write each download at the correct offset, keep the pack available for indexing, and handle completed downloads. Accept an existing keep file only when its pack hash matches the advertised value.

seen3 threads

In upstream seen and still under review.

[04]

packfile: recover safely from duplicate object entries

seen
From
Taylor Blau
Date
24 Jul 2026
Patches
5

Duplicate objects in a pack could confuse reverse indexes, multi-pack indexes, and bitmap reuse.

Match objects to their actual pack offsets, recover usable copies when resolving deltas, and avoid unsafe bitmap reuse. Fall back to ordinary packing when a selected index entry does not match its physical pack position.

[07]

midx: honor custom incremental base layers

seen
From
Taylor Blau
Date
12 Jun 2026
Patches
3

Incremental multi-pack-index writes ignored the requested base and omitted packs needed by later layers.

Honor the selected base and include newer packs so the resulting index and bitmap remain usable. Packs above the requested base are included instead of being silently excluded from the new layer.

[33]

pack-objects: trace pack bytes written

seen
From
Friel
Date
19 Aug 2026
Patches
1

Trace2 reported how many objects were packed, but not the resulting pack size.

Record total pack bytes alongside the object count so compression settings can be compared. Include pack headers and checksums, count output written to stdout or disk, and sum the sizes when the output is split across multiple packs.

openai/git19 threads

Merged into openai/git; not yet merged upstream.

[13]

maintenance: handle geometric repacks with promisor packs

openai/git
From
Taylor Blau
Date
4 Aug 2026
Patches
2

Geometric maintenance considered only ordinary packs, so partial clones could rewrite promisor packs unnecessarily or skip an eligible automatic rollup.

Consider both ordinary and promisor pack progressions when choosing geometric versus all-into-one repacks and when deciding whether --auto has work. This preserves large promisor packs and lets all-promisor repositories roll up smaller packs.

[15]

dir: skip recursively valid empty UNTR subtrees

openai/git
From
Taylor Blau
Date
24 Jul 2026

Git reopened cached directories even after confirming they contained no untracked files.

Reuse cached empty directories after confirming that their contents and ignore rules have not changed. A modified .gitignore still triggers the normal directory checks.

[16]

read-cache: decode bounded TREE and UNTR extensions in parallel

openai/git
From
Taylor Blau
Date
21 Jul 2026

Git decoded its cache-tree and untracked-cache index extensions one after the other.

Decode the two independent extensions in parallel when enough index workers are available. Use the additional worker only for large extensions and leave split-index assembly unaffected.

[17]

fsmonitor: bind daemon queries to the canonical worktree root

openai/git
From
Taylor Blau
Date
11 Jul 2026

Linked worktrees could ask the wrong filesystem-monitor daemon for change history.

Associate each daemon query with the correct worktree before using its results. Check both the canonical worktree path and its filesystem identity so linked checkouts cannot share the wrong history.

[18]

fsmonitor: invalidate attributes for matched directory summaries

openai/git
From
Taylor Blau
Date
24 Jul 2026

A changed directory could leave outdated .gitattributes rules cached.

Refresh cached attributes when a filesystem-monitor event affects tracked files in that directory. Unrelated directory events keep their existing fallback behavior.

[19]

status: close fsmonitor tokens around complete status scans

openai/git
From
Taylor Blau
Date
29 Jul 2026

Files could change while git status was scanning the worktree.

Check the filesystem monitor again after the scan so changes during the scan are not missed. If the monitor reports an intervening edit, repeat the affected scan instead of trusting the earlier result.

[20]

status: fingerprint configuration for semantic clean proofs

openai/git
From
Taylor Blau
Date
11 Jul 2026

A cached clean status becomes invalid when relevant Git configuration changes.

Track settings that affect status and file conversion, and discard cached results when those settings change. Keep unrelated configuration changes from invalidating an otherwise usable result.

[21]

attr: fingerprint external sources in stable namespaces

openai/git
From
Taylor Blau
Date
11 Jul 2026

Global, system, and repository attributes can change how Git interprets tracked files.

Track those attribute files and their locations before reusing an earlier status result. Include missing files and replaced directories so a changed attribute source cannot go unnoticed.

[22]

status: hold external attributes stable across refresh

openai/git
From
Taylor Blau
Date
21 Jul 2026

An external attributes file could be replaced between its initial check and the later status scan.

Use the same snapshot of external attributes throughout the scan. This prevents Git from checking the index against one set of rules and collecting status against another.

[23]

commit: close fsmonitor tokens across pre-commit hooks

openai/git
From
Taylor Blau
Date
21 Jul 2026

A pre-commit hook can modify a tracked file after Git has already refreshed its index.

Check the filesystem monitor again after the hook so later status does not reuse stale results. This also catches edits that preserve the file's size and modification time.

[24]

t7529: cover APFS preload directory and root replacement

openai/git
From
Taylor Blau
Date
28 Jul 2026

A directory or worktree root can be replaced while an APFS scan is running.

Pause the scan, replace either a child directory or the worktree root, and confirm Git rejects the collected results. Normal status then falls back to a fresh filesystem scan.

[25]

status: consume definitive bulk changes exactly once

openai/git
From
Taylor Blau
Date
24 Jul 2026

A bulk scan already detects deleted files and size changes that git status otherwise checks again.

Reuse already detected deletions and size changes instead of rediscovering them later. Continue inspecting files whose metadata changed without clearly establishing whether their contents changed.

[26]

dir: reject oversized pattern files before allocation

openai/git
From
Taylor Blau
Date
24 Jul 2026

Git allocated memory for ignore and attribute files before rejecting files larger than 100 MiB.

Check file size before allocation to avoid wasted memory and allocation failures. Preserve the existing warning and retain the later size check for inputs read from the index.

[27]

status: reuse complete APFS untracked preload results

openai/git
From
Taylor Blau
Date
21 Jul 2026

Git status walked the worktree twice: once during APFS preload and again to find untracked files.

Reuse untracked-file results from the completed scan when the same ignore rules still apply. Keep the ordinary directory walk for changed ignore files, nested repositories, and unsupported reporting modes.

[28]

preload-index: enable the verified Linux bulk scan backend

openai/git
From
Taylor Blau
Date
21 Jul 2026

Linux needed one backend to coordinate bulk filesystem scans and their safety checks.

Combine directory enumeration, file metadata, anchored opens, and filesystem checks before accepting scan results. Limit the fast path to supported Linux filesystems and fall back when a required system feature is missing.

[29]

status: refresh verified writable bulk-preload entries

openai/git
From
Taylor Blau
Date
21 Jul 2026

Git rechecked unchanged file contents because refreshed metadata was not written back to the index.

Update index metadata after a successful content check when Git holds the index lock. Later status runs can then trust the refreshed file information instead of reading the same contents again.

[30]

status: close bulk content proofs with the provider token

openai/git
From
Taylor Blau
Date
29 Jul 2026

Bulk content checks could be invalidated by concurrent changes before the closing filesystem-monitor query.

Retain provisional clean states and index updates until the provider confirms the same proof epoch, then publish them only after revalidating pending paths. Provider failure or epoch changes fall back to a complete refresh.

[31]

status: reuse closed proofs for scoped queries

openai/git
From
Taylor Blau
Date
11 Aug 2026

Scoped status queries repeated work even when a root-wide clean proof already covered the requested paths.

Reuse closed clean-status and untracked-cache proofs for eligible literal path queries. Preserve ordinary invalidation for changed exclusions, complex pathspecs, sparse indexes, and unsupported directories.

[32]

t7527: cover closed scoped untracked-cache reuse

openai/git
From
Taylor Blau
Date
11 Aug 2026
Series patches
125

Scoped status reuse needed regression coverage across root and nested working directories.

Exercise repeated tracked-directory queries after filesystem monitoring closes the selected untracked-cache subtree. Verify scoped results stay correct, avoid directory walks, preserve the index, and reject later root-wide ignore invalidation.

cooking here6 threads

In our topic branches; not yet merged upstream.

[08]

checkout: avoid rewriting an unchanged index

cooking here
From
Ted Nyman
Date
28 Jul 2026
Patches
1

Checking out or restoring an unchanged path rewrote the index even when nothing changed.

Skip the index write when checkout does not change any entries. Both git checkout and git restore retain their existing behavior when an installed post-index-change hook requires the write.

[09]

branch: avoid a six-hour Coccinelle matching slowdown

cooking here
From
Ted Nyman
Date
24 Jul 2026
Patches
1

A reused loop index made Coccinelle's static analysis run for hours and hit CI's six-hour limit.

Declare separate loop indexes so static analysis can finish normally. Branch deletion behaves exactly as before; each loop variable now stays within the loop that uses it.

6 h static-analysis timeout

5 lines isolated loop indexes

[10]

fetch-pack: trace external packfile-URI downloads

cooking here
From
Ted Nyman
Date
26 Jul 2026
Commit
b1262a537b6c
Patches
1

Trace2 showed fetch negotiation but not the time spent downloading packfile URIs.

Add one Trace2 region around the downloads and record the number of advertised packfiles. This exposes external download time without emitting a separate tracing event for every pack.

[11]

pack-bitmap: weight graph paths by dominated history

cooking here
From
Taylor Blau
Date
14 Jul 2026
Patches
5

Bitmap selection undervalued merge commits that expose large amounts of repository history.

Choose bitmap commits based on the history they make reachable rather than path length alone. The measured build fell from 984.73 seconds to 200.06 seconds while both runs selected the same 578 bitmaps.

984.73 s MIDX bitmap write

200.06 s MIDX bitmap write

[12]

parallel-checkout: trace per-worker load

cooking here
From
Taylor Blau
Date
20 Jul 2026
Patches
2

Parallel checkout reported collisions but not how work was distributed among workers.

Record each worker's item count, bytes, failures, elapsed time, and slowest item when Trace2 is enabled. These counters show whether a long checkout comes from uneven work or one unusually slow file.

[14]

index-pack: optionally allow duplicate objects

cooking here
From
Friel
Date
27 Jul 2026
Patches
1

Full clones rejected connected packs containing duplicate objects even though shallow and filtered clones already accepted them.

Add an opt-in index-pack setting for accepting duplicate objects during the initial fetch while preserving object validation, connectivity checks, delta resolution, and strict verification. The RFC builds on the duplicate-pack hardening series.

not queued2 threads

Retracted or discarded upstream proposals, retained as historical notes.

[05]

send-pack: negotiate packs without REF_DELTA objects

not queued
From
Taylor Blau
Date
12 Jul 2026
Patches
4

Some Git servers cannot accept REF_DELTA objects, but clients could not negotiate that restriction.

Add a no-ref-delta capability and teach send-pack and pack-objects to honor it. Keep the new restriction independent of ofs-delta so servers can state exactly which object formats they accept.

[06]

repack: combine geometric rollups with cruft packs

not queued
From
Taylor Blau
Date
26 Jun 2026
Patches
10

Git could not combine geometric repacking and cruft packs in the same operation.

Roll older packs together while writing unreachable objects to a separate cruft pack. Leave packs outside the geometric rollup available and use a consistent reference snapshot when generating bitmaps.