Repository navigation
Commit 5a43fa7
committed
doctor: report git object store health
Codex writes snapshot trees and refs/codex/* refs into the repository as it
works, and nothing packs or prunes them unless git gc or git maintenance
runs. A write that is interrupted part-way also leaves tmp_obj_* and
tmp_pack_* files behind that git gc reports as garbage but never removes.
Over time a workspace can carry hundreds of megabytes of loose objects that
slow every status, diff and snapshot command, and nothing in the doctor
report points at it.
Add a "git objects" check to codex doctor that inspects the object store of
the working directory's repository from the filesystem, without executing
git, in keeping with the existing git check:
- loose object count and size, pack file count and size
- leftover tmp_obj_* / tmp_pack_* / tmp_idx_* files
- number of refs under refs/codex/, including packed refs
- whether the repository is registered for git maintenance in the global
config (linked worktrees are matched by their main worktree)
It warns when garbage files exist or when loose objects exceed git's own
gc.auto threshold (6700 objects) or 200 MiB, and the remedy names
git maintenance register / start or a one-off git gc.1 parent 79be2e2 commit 5a43fa7
3 files changed
Lines changed: 704 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
| 432 | + | |
431 | 433 | | |
432 | 434 | | |
433 | 435 | | |
| |||
480 | 482 | | |
481 | 483 | | |
482 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
483 | 490 | | |
484 | 491 | | |
485 | 492 | | |
| |||
519 | 526 | | |
520 | 527 | | |
521 | 528 | | |
| 529 | + | |
522 | 530 | | |
523 | 531 | | |
524 | 532 | | |
| |||
533 | 541 | | |
534 | 542 | | |
535 | 543 | | |
| 544 | + | |
536 | 545 | | |
537 | 546 | | |
538 | 547 | | |
| |||
548 | 557 | | |
549 | 558 | | |
550 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
551 | 563 | | |
552 | 564 | | |
553 | 565 | | |
| |||
560 | 572 | | |
561 | 573 | | |
562 | 574 | | |
| 575 | + | |
563 | 576 | | |
564 | 577 | | |
565 | 578 | | |
| |||
0 commit comments