Skip to main content

Module log

Module log 

Source
Expand description

mkit log [<rev>] [<A>..<B> | <A>...<B>] — walk commit history.

With no argument the walk starts at HEAD. A single <rev> starts there instead; a range A..B shows commits reachable from B but not A (empty side = HEAD, so A.. is A..HEAD and ..B is HEAD..B). An A...B symmetric range shows commits reachable from A or B but not their common ancestors (the merge base). Commits are ordered reverse-chronologically with a topological tie-break (a parent never precedes a child) — git’s --date-order. This is identical to git’s default for linear history and monotonic-timestamp merges; it can differ only on merge DAGs with non-monotonic (skewed or imported) timestamps.

Output modes:

  • default — human-oriented multi-line per commit on stdout. The full commit message body is printed indented (four spaces) and the timestamp is rendered as a stable UTC date (YYYY-MM-DD HH:MM:SS +0000), not the raw integer.
  • --oneline<abbrev-hex> <title> per commit on stdout. The abbreviation length defaults to 7 (DEFAULT_ABBREV) and is overridable with --abbrev[=N].
  • --format=json — JSONL, one self-contained JSON object per commit. Suitable for piping into jq.

--graph is silently accepted as a no-op pending Phase 10.

Argument parsing is delegated to clap-derive via crate::clap_shim::parse; clap emits standard diagnostics on errors and the shim maps them to mkit sysexits (USAGE for unknown flags, DATAERR for malformed -n values, etc.).

Functions§

run