Skip to main content

Module status

Module status 

Source
Expand description

mkit status — show working-tree changes relative to HEAD.

§Default (human) output

on branch <name>           # to stderr  (or "detached HEAD at <hash>" / "no HEAD yet")
                           #
Changes to be committed:   # to stderr
  A  added.txt             # to stderr
  D  deleted.txt           # to stderr

Changes not staged for commit:    # to stderr
  M  modified.txt                 # to stderr

Banners and section headers go to stderr; per-file lines also go to stderr in default mode because they are formatted for humans. Scripts should use --porcelain (see below) for stdout output that is safe to parse.

§--porcelain[=v1] / -s (--short) output

-s/--short is an alias for --porcelain=v1; both select the same renderer. Compatible with git status --porcelain — one entry per line, two-character XY status code, space, path:

M  modified-staged.txt
 M unstaged-edit.txt
A  newly-staged.txt
?? untracked.txt

X is the staged-vs-HEAD state; Y is the worktree-vs-index state. mkit’s DiffKind::ModeChanged renders as T (a non-git extension). ?? is the conventional code for untracked files.

Paths containing special bytes are C-style quoted (matching git’s default core.quotePath). With -z, records are NUL-terminated and paths are emitted raw (unquoted) — the round-trip-safe form for paths with newlines or other special bytes; -z implies porcelain.

Empty stdout means “nothing to commit, working tree clean.”

§--porcelain=v2 output

Selects git’s richer per-path format. Each changed tracked path is a 1 record:

1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>

where XY uses . (not space) for an unchanged column, <sub> is always N... (mkit is never a submodule), <mH>/<mI>/<mW> are the octal file modes in HEAD / index / worktree, and <hH>/<hI> are the HEAD and index object ids (full 64-hex BLAKE3; git’s are 40-hex SHA-1, so the differential harness masks length). Untracked paths are ? <path> records, and a rename emits a 2 record (R100, exact content). There are no --branch header lines. Path quoting and -z semantics match the v1 renderer.

Functions§

run