Skip to content

Week 7 - M2: Polish status + diff output #45

Open

Description

@aman-a-shah

Current checkpoint (2026-11-18)

Steps

  1. Run status and diff through the completed Week 6 workflow: clean repo, edits, staging, pull, merge conflict, resolution, and commit. List formatting gaps before changing behavior.
  2. Make status easy to scan: current branch, staged changes, unstaged changes, untracked files, and a clear clean/unborn result.
    • Stable path ordering; omit empty change sections
    • A staged file edited again must appear in both relevant sections
    • Show pending/unresolved merge paths through an agreed M3 helper; M3 owns merge state
  3. Polish diff with consistent old/new file headers, hunk locations/context, and visibly distinct added/removed lines. Document the hunk position convention.
    • Keep the existing HEAD-tree-versus-working-files comparison explicit in help/docs
    • Unborn HEAD compares against an empty snapshot
    • Preserve added/deleted files, mode-only changes, and missing-final-newline information
    • Binary/undecodable files get a readable summary, never a text decode traceback
  4. Keep formatting separate from the handwritten Myers algorithm and reusable edit data. Do not replace the algorithm with difflib, Git, or a diff library.
  5. Ensure output is readable when redirected: deterministic plain text, no required color, pager, or terminal-only dependency. Handle spaces and Unicode paths clearly.
  6. Audit expected index/path/checkout failures with M3's shared error contract. Include the affected path and a useful next step while preserving the shared exception type.
  7. Keep status/diff read-only, including unborn and conflicted repositories. Exclude .minigit/; preserve local edits and existing checkout protections.
  8. Measure clean/changed status and a one-file diff on M4's shared fixture. Fix only measured repeated work without changing results; record remaining findings for Week 8.
  9. Update the README examples; scripts/quality-check.sh -> linked PR -> teammate review.

Tests

  • Stable output for clean/unborn repos and all three status sections
  • Staged-then-edited file, nested/Unicode/space-containing paths, additions/deletions, modes
  • Diff headers/hunks, repeated lines, empty files, missing final newline, binary summary
  • Pull conflict -> unresolved status -> resolve -> add -> commit -> clean status across fresh CLI calls
  • Snapshot objects, refs, HEAD, index, merge state, and files before/after status/diff: unchanged
  • Small output regressions in normal tests; performance measurements remain opt-in

Done when

  • Status and diff output is consistent, readable, and documented
  • Merge status uses M3's state without taking ownership of it
  • Read-only commands and working-tree safety retain their guarantees
  • Status/diff measurements recorded on the shared fixture
  • Quality check green; PR open; review requested

Activity

  1. added
    module-2
    week-7
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

module-2week-7

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions