Skip to content

Add --git object-store counting mode#11

Merged
alyx merged 1 commit into
mainfrom
codex/git-object-counting
Jul 12, 2026
Merged

Add --git object-store counting mode#11
alyx merged 1 commit into
mainfrom
codex/git-object-counting

Conversation

@alyx

@alyx alyx commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • add --git as an object-store-backed counterpart to --tracked, leaving --tracked behavior unchanged
  • stream clean indexed blobs through one long-lived, pipelined git cat-file --batch process per repository
  • read modified, conflicted, and symlink-followed paths from the filesystem to preserve working-tree semantics
  • expose the mode as git: true in configuration and document its behavior

Closes #7.

Impact

Large clean repositories can avoid opening every tracked source file individually. The existing --tracked mode remains filesystem-backed, while --git opts into Git object access. Loose objects and packed objects are handled by Git itself; failures reading an object transparently fall back to the filesystem.

Validation

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • differential tests covering clean, staged, modified, untracked, subdirectory, shebang, dedup, per-file, and followed-symlink behavior
  • byte-identical --tracked / --git per-file JSON reports on a temporary Git repository containing the local Go standard-library source tree: 11,408 indexed files, 1.5 MB report
  • packed warm-cache sample: system CPU decreased from about 1.07s (--tracked) to 0.53s (--git); wall time increased from 0.38s to 0.95s due to object inflation and ordered streaming

@alyx
alyx marked this pull request as ready for review July 12, 2026 18:11
@alyx
alyx merged commit db4255c into main Jul 12, 2026
1 check passed
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.

--tracked: read blob contents from the git object store instead of the filesystem

1 participant