Repository navigation
Open
Description
- Owner: @Saanvi521 ·
minigit/index.py,tests/test_index.py,tests/test_checkout_safety.py - Docs: status/diff examples in README; working-tree results in
docs/performance.md - Depends on: Week 6 - M2: Working-tree safety for pull + merge round-trips #39, Week 7 - M2: Polish status + diff output #45; use the shared benchmark from Week 7 - M4: Network diagnostics + end-to-end performance baseline #47 and M3's merge-state helper from Week 7 - M3: Polish log output + shared CLI errors #46
- Branch from updated
main:feat/working-tree-performance-finalization - Finish the linked Week 6/7 prerequisites first, then rebase on updated
main - Preserve
DiffResult, the reusable Myers helper, and staging/checkout contracts; M3 owns refs, HEAD, and pending merge state
Current checkpoint (2026-11-18)
- Landed: W8: feat/working-tree-performance-finalization #64 delivers the measured per-directory file-walk optimization, same-size/preserved-timestamp regression, and Week 7 output changes.
- Remaining: check in a reproducible working-tree benchmark (the report currently references missing
bench_working_tree.py) or replace the instructions with Week 7 - M4: Network diagnostics + end-to-end performance baseline #47's actual runner; record comparable revisions/fixtures. Adoptget_merge_status()in both remaining M2 callers, update README examples, and verify Week 8 - M4: Network performance + final end-to-end checkpoint #58's integrated checkpoint. - Coordinate the helper migration with Week 7 - M2: Polish status + diff output #45/Week 7 - M3: Polish log output + shared CLI errors #46/Week 8 - M3: History performance + final CLI consistency audit #57 and the final documentation handoff in Week 10 - M2: Working-tree acceptance + final demo documentation #68; these are shared outstanding tasks, not separate duplicate implementations.
Steps
- Reproduce Week 7 clean/changed status and diff measurements. Include many unchanged files, one changed file, several changed files, and a larger text file; identify the repeated work that actually dominates.
- Fix a bounded measured cost, such as redundant tree/index reads, repeated file hashing, or line-diff work where only file status is needed. Keep the handwritten Myers algorithm and existing HEAD-tree-versus-working-files diff semantics.
- Avoid correctness shortcuts: same-sized content changes must still be found, including when file timestamps are preserved. Do not persist an optimization cache that makes read-only status/diff write repository state.
- Close remaining Week 7 output gaps on the completed pull/merge workflow. Keep staged, unstaged, and untracked results distinct; staged-then-edited files appear in both relevant sections. Use the agreed M3 helper for pending/unresolved merge information rather than a placeholder or duplicate parser.
- Recheck diff headers/context, additions/deletions, mode-only changes, binary summaries, empty files, missing final newlines, and Unicode/space-containing paths. Output remains deterministic and readable when redirected.
- Preserve checkout validation before destructive writes and explicit resolve -> add -> commit behavior, including resolution by deletion. Unsafe checkout and validation failures must retain local files and index; status/diff must not mutate objects, refs, HEAD, index, merge state, or files.
- Add focused regressions for fixes and contribute working-tree assertions to M4's Week 8 checkpoint. Reuse existing safety and integration helpers instead of copying whole suites.
- Record comparable before/after results in
docs/performance.mdand update README examples to match actual output. If profiling finds no worthwhile optimization, record that evidence and complete the remaining polish/regressions. - Run
scripts/quality-check.sh; open a linked PR and request teammate review. Coordinate README and shared-file edits with M3/M4.
Tests
- Clean/unborn repositories, staged-then-edited files, additions/deletions, modes, nested paths, binary data, and missing final newlines
- Same-size edits with preserved timestamps are detected; Myers edit results remain valid for repeated lines and larger text
- Pull -> conflict -> unresolved status -> resolve -> add -> two-parent commit -> clean status across fresh CLI processes
- Dirty work, untracked collisions, unsafe paths, missing/corrupt blobs, and file/directory blockers preserve the existing checkout guarantees
- Before/after state snapshots confirm status/diff are read-only; performance timing stays outside normal CI
Done when
- Week 7 working-tree findings are resolved or documented with evidence and a follow-up
- Any optimization preserves results and has comparable measurements
- Final status/diff and conflict-resolution behavior have focused regressions
- README examples and working-tree performance results are current
- Quality check green; PR open; review requested
Activity