Skip to content

Week 7 - M3: Polish log output + shared CLI errors #46

Open

Description

@aman-a-shah

Current checkpoint (2026-11-18)

Steps

  1. Polish minigit log: readable commit ID, author, date with an explicit timezone, message, and both parent IDs for merge commits. Keep compact summaries available, for example through --oneline.
  2. Separate presentation from commit parsing and history traversal. Preserve callable helpers used by M4 and coordinate any additive interface with callers.
  3. Follow both parents and show each reachable commit once. Document deterministic ordering and tie-breaking; timestamps must never decide ancestry or cause commits to disappear.
  4. Handle unborn history and multiline/Unicode messages clearly. Log and branch listing must not write objects, refs, HEAD, index, files, or merge state.
  5. Give local branch/checkout/merge results accurate messages for up-to-date, fast-forward, clean merge, and conflict outcomes. Preserve merge(branch_name) -> str | None; agree on any additive result helper instead of changing that signature alone.
  6. Coordinate the shared CLI error audit against minigit/errors.py.
    • Expected repository errors -> concise minigit: ... on stderr and a nonzero exit code
    • Successful command output -> stdout; keep argparse's usage-error behavior
    • Preserve missing/corrupt object, missing/existing ref, merge-conflict, and network distinctions
    • Keep MergeConflictError.paths intact and explain resolve -> add -> commit when relevant
    • Translate expected filesystem/parse failures at the responsible module boundary; do not hide programming errors with a blanket catch
  7. Expose pending/unresolved merge information to M2 through a documented read-only helper. M3 continues to own pending state, parent order, and ref publication.
  8. Add subprocess CLI checks so exit codes and stdout/stderr match real invocations. Coordinate shared-file edits with the other owners.
  9. Measure log and history traversal on M4's fixture, including a merge DAG. Avoid repeated parsing where evidence warrants a fix; keep both-parent correctness.
  10. Update README examples and record audit/performance findings for Week 8; scripts/quality-check.sh -> linked PR -> teammate review.

Tests

  • Root, linear, and two-parent history; shared ancestors printed once
  • Equal/skewed timestamps, multiline/Unicode messages, compact and detailed output
  • Unborn repo; unknown/existing branch; invalid ref; missing/corrupt commit
  • Fast-forward/no-op/merge/conflict messages; unresolved commit remains blocked
  • Expected failures: nonzero exit, readable stderr, no success message or traceback; conflict paths preserved
  • Read-only history commands leave repository state unchanged; no timing-based CI assertions

Done when

  • Log output is useful and deterministic without changing graph semantics
  • CLI outcomes and expected errors use consistent streams/messages/exit codes
  • M2 can read merge status through an agreed helper
  • History baseline and remaining audit findings recorded
  • Quality check green; PR open; review requested

Activity

  1. added
    module-3
    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-3week-7

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions