Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.36 KB

File metadata and controls

58 lines (44 loc) · 1.36 KB

Git Examples

Use compact Git output for human review and exact Git output when another tool must consume the patch or status bytes.

Working Tree Review

cx -- git status
cx -- git diff
cx -- git diff -- src/lib.rs src/dispatch.rs
cx -- git diff --stat
cx -- git diff --name-only --diff-filter=U
cx -- git diff --check

git diff is compact by default. Stat, name, raw, check, quiet, and other machine-oriented modes stay exact. Use --no-compact for a full human-readable unified diff:

cx -- git diff --no-compact -- src/lib.rs

History

cx -- git log -n 20 --oneline
cx -- git log --no-compact -1 --format=fuller HEAD
cx -- git show --stat HEAD

User-supplied Git formatting remains authoritative. --no-compact disables CX's default history projection.

Exact Patch Evidence

mkdir -p .tmp
cx evidence-diff HEAD^..HEAD > .tmp/cx-exact-commit.diff
wc -c .tmp/cx-exact-commit.diff

evidence-diff emits the raw no-color patch. With no range, it chooses a first-parent diff for ordinary commits and a root-safe git show form for an initial commit.

Conflict Stages

cx conflict-diff --stat src/config.rs
cx conflict-diff --no-compact src/config.rs
cx conflict-diff --stage 1:3 src/config.rs

This compares Git index stages without shell process substitution, temporary named files, or ambiguous /dev/fd handling.