git: notes on large repositories

openai-git-upstream.openai.chatgpt.site · 2026-08-01 · by Long Nguyen ·generic
OpenAI's work on Git for large repositories.

git: notes on large repositories

openai/git

patches / upstream status☀theme

FromTed Nyman

Date20 Jul 2026

Commit1be6ebe26403

Patches2

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

FromTaylor Blau

Date21 Jun 2026

Commit7e6de2ac6281

Patches4

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.

FromTed Nyman

Date26 Jul 2026

Commitc4244bdfe6d2

Patches6

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.

FromTaylor Blau

Date24 Jul 2026

Commitfd2739b159d0

Patches5

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.

FromTaylor Blau

Date12 Jul 2026

Commit90202ce6e1da

Patches4

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.

FromTaylor Blau

Date26 Jun 2026

Commita53c3b619337

Patches10

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.

FromTaylor Blau

Date12 Jun 2026

Commit6afc679fa623

Patches3

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.

FromTed Nyman

Date28 Jul 2026

Commitedb762a50b66

Patches1

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.

FromTed Nyman

Date24 Jul 2026

Commit047e0526de0f

Patches1

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

FromTed Nyman

Date26 Jul 2026

Commitb1262a537b6c

Patches1

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.

FromTaylor Blau

Date14 Jul 2026

Commit89fbe6e55f1e

Patches5

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

FromTaylor Blau

Date20 Jul 2026

Commit4e342ff99030

Patches2

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.

FromTaylor Blau

Date23 Jul 2026

Commite6386b0dde89

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.

FromTaylor Blau

Date21 Jul 2026

Commitf0a23ff73781

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.

FromTaylor Blau

Date10 Jul 2026

Commit77a6a7b11093

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.

FromTaylor Blau

Date24 Jul 2026

Commit303c4b593ec9

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.

FromTaylor Blau

Date29 Jul 2026

Commit0dce5c081334

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.

FromTaylor Blau

Date10 Jul 2026

Commitbc1e48f1b660

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.

FromTaylor Blau

Date10 Jul 2026

Commite9229c085ca0

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.

FromTaylor Blau

Date20 Jul 2026

Commite0fd8e78a324

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.

FromTaylor Blau

Date21 Jul 2026

Commitf95725ceeb52

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.

FromTaylor Blau

Date28 Jul 2026

Commita48a2e16a003

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.

FromTaylor Blau

Date23 Jul 2026

Commitd04644c3b1df

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.

FromTaylor Blau

Date24 Jul 2026

Commitb0eae77b29b6

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.

FromTaylor Blau

Date21 Jul 2026

Commit38fd26afdb0a

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.

FromTaylor Blau

Date21 Jul 2026

Commit0b384d1180fa

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.

FromTaylor Blau

Date21 Jul 2026

Commit57049bffa6de

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.

FromTaylor Blau

Date29 Jul 2026

Commit1cd499f1e3bc

Files can change between a bulk content check and the final filesystem-monitor query.

Keep the scanned file descriptors and metadata available until the final filesystem-monitor check. Accept the results only after confirming that no concurrent worktree change invalidated the scan.

FromTaylor Blau

Date21 Jul 2026

Commitc0f1f813b884

Document an optional .csts file that records a known-clean git status --porcelain=v2 result.

On a main APFS worktree, reuse the result only after checking the index, HEAD, configuration, attributes, ignore rules, and filesystem-monitor history. Missing, stale, or malformed cache files always fall back to ordinary status.

FromTaylor Blau

Date29 Jul 2026

Commit808d019d06c0

Patches105

Combine the 18 git status topic branches into one 105-patch series.

Keep the filesystem-monitor, untracked-cache, bulk-scan, and index changes together without dropping their tests. Preserve the branch dependencies so all 105 patches remain represented at the integration tip.

Comments (0)

No comments yet