Skip to content

git_compact: keep repositories packed without losing history - #342

Open
plur9 wants to merge 1 commit into
mainfrom
fix/git-compaction
Open

plur9 wants to merge 1 commit into
mainfrom
fix/git-compaction

Conversation

@plur9

@plur9 plur9 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Git packs a repository only past an object count, and plumbing commits never trigger it. The memory store sync commits with plumbing, so its store grew without bound (5.3 GB loose, 135 MB packed).

  • git_compact.py: lossless compaction (prune and reflog expiry off, commit counts checked before and after); lowers gc.auto and gc.autoPackLimit so git packs sooner on its own; --if-heavy packs only past a size limit.
  • plur_store_sync.py: packs the store once loose objects pass 100 MB (PLUR_SYNC_PACK_LOOSE_MB). A failure is recorded in the sync state, never fatal.
  • Tests: test_git_compact.py (5) and one new case in test_plur_store_sync.py, all seen red first; 19 pass.

Already run by hand on every machine; this makes the memory store stay packed.

🤖 Generated with Claude Code

…ory sync packs its store

Git packs a repository only past an object count, and plumbing commits (hash-object, commit-tree) never trigger it at all. A memory store that re-commits a 30 MB file every two hours grew to 5.3 GB of loose objects; packed it is 135 MB.

git_compact.py compacts losslessly (prune and reflog expiry off, commit counts checked before and after) and lowers gc.auto and gc.autoPackLimit so git's own packing starts sooner. plur_store_sync packs its store once loose objects pass 100 MB (PLUR_SYNC_PACK_LOOSE_MB). Tests seen red first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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