mantish/ help / docs
Join the waitlist

Text formats

The three human- and agent-readable text renderings, and what their preamble tells you.

Last updated

All three render the same document, so they agree on the selection, the counts and what was left out. Only the layout differs.

Source first, statistics on request

By default a text format writes the change and what changes how it must be read — nothing else:

text
# mantish-review v1 (a filtered review, not a patch)
diff --git a/Order.cs b/Order.new.cs
--- a/Order.cs
+++ b/Order.new.cs
@@ -3,5 +3,6 @@
     public decimal Total()
     {
-        return _lines.Sum(l => l.Price);
+        return _lines.Sum(l => l.Price * l.Qty);
+        // rounded at checkout
     }
 
# 3 files not shown: every edit hidden by the selection
  • A rename still says # renamed from <path>, a file that could not be compared still says why (# modified; not compared: binary, too-large, timed out), and a byte-order mark added, removed or changed, a changed final newline or changed line endings still get their # note.
  • A file with nothing left to show — every edit hidden, or every difference one the whitespace mode ignores — prints nothing of its own. The closing # N files not shown line keeps its absence visible; files an ignore rule matched get a line of their own.
  • When nothing you selected can hide anything, the engine skips its semantic analysis and compares the files line by line: the output is the same, and it is much faster.

--stats (or "stats": true in a profile) writes the full account below: the preamble's facts, each file's status and counts, each hunk's change types, and every omission. Add it when you need to check coverage or what the selection hid.

The preamble (--stats)

text
# mantish-review v1
# patchApplicable: false (a filtered review, not a patch)
# engine: 0.21.0
# target: files Order.cs -> Order.new.cs
# selection: whitespace=exact context=3 mute=formatting hide=whitespace spotlight=breaking
# presentation: v1:4f2a9c07
# coverage: complete
# filtered: yes
# files: 1 listed, 1 with changes left, 0 ignored
# edits: 2 visible, 1 omitted, 1 mixed, 0 unclassified; 2 hidden changes; 0 line endings changed
  • target — what was compared, with commit ids for a repository comparison, and the merge base for a range.
  • selection — the tag sets and whitespace mode actually in force; none for an empty set.
  • presentation — a fingerprint of the rules the engine judged by, including the policies you did not set on the command line. One export is always judged under one fingerprint.
  • coverage — complete, or incomplete (N of M files without semantic analysis).
  • filtered — whether any rule or whitespace mode may have left something out.

diff

sh
mantish diff Order.cs Order.new.cs --format diff --stats
diff
diff --git a/Order.cs b/Order.new.cs
# modified; language: csharp; analysis: complete; edits: 2 visible, 1 omitted, 1 mixed, 0 unclassified; hidden: whitespace=2
--- a/Order.cs
+++ b/Order.new.cs
@@ -3,5 +3,6 @@ modified:logic added:breaking/spotlight
     public decimal Total()
     {
-        return _lines.Sum(l => l.Price);
+        return _lines.Sum(l => l.Price * l.Qty);
+        // rounded at checkout
     }
 
@@ -14,3 +15,3 @@ modified:formatting/muted mixed
     public void Add(Line line)
-    {  _lines.Add(line); }
+    { _lines.Add(line);  }

Familiar unified layout — a count of one is written as git writes it, @@ -1 +1 @@ — with three additions under --stats:

  • The # line under each file header states its status, language, analysis and counts.
  • Each @@ header is annotated with the changes in that hunk: type:tag,tag, plus /muted or /spotlight when it is not simply shown, and mixed when visible logic and hidden noise share a line. Each distinct annotation appears once, in the order it first appears, followed by ×N when N changes share it: modified:logic×3 deleted:import/muted×2.
  • A file with nothing to show says why instead of printing source — omitted: every edit is hidden by the selection, empty file, no text difference under the selection, and so on.

Line numbers are the original source coordinates, and /dev/null stands in for a side that does not exist. Renames add # renamed from <path>; a byte-order mark added, removed or changed — # BOM added: the file now starts with a UTF-8 byte-order mark. — a changed final newline or changed line endings get their own # note.

This is not a patch. Hidden changes are gone from it by design, so git apply cannot and must not be used on it. That is what patchApplicable: false in the preamble means.

side-by-side

sh
mantish diff Order.cs Order.new.cs --format side-by-side --width 80 --stats
text
# layout: before | after; rows at most 80 cells wide; tabs expand to stops of 4; a row without a line number continues the one above

== Order.cs -> Order.new.cs
# modified; language: csharp; analysis: complete; edits: 2 visible, 1 omitted, 1 mixed, 0 unclassified; hidden: whitespace=2
@@ -3,5 +3,6 @@ modified:logic added:breaking/spotlight
 3       public decimal Total()        |  3       public decimal Total()
 4       {                             |  4       {
 5 -         return _lines.Sum(l => l. |  5 +         return _lines.Sum(l => l.
   - Price);                           |    + Price * l.Qty);
                                       |  6 +         // rounded at checkout
 6       }                             |  7       }
  • --width is a maximum, not a target: columns are only as wide as the text needs, and nothing is ever truncated. A long line continues on rows that have no line number and repeat the marker.
  • Each run of removed lines sits beside the run of added lines that follows it; the longer run leaves the other side blank.
  • Tabs expand to stops of 4, wide characters and grapheme clusters are measured in terminal cells, and an escape sequence is never split across rows.
  • Minimum width is 40; the default is 160 regardless of your terminal size, so captured output does not depend on the window it was captured in.
Side-by-side output
Side-by-side output

markdown

sh
mantish diff main...feature --format markdown --stats > review.md
markdown
# Mantish review

A filtered review, not a patch (`mantish-review v1, patchApplicable: false`): changes the selection hides are left out and counted.

- **Engine:** `0.21.0`
- **Target:** files Order.cs -> Order.new.cs
- **Selection:** `whitespace=exact context=3 mute=formatting hide=whitespace spotlight=breaking`
- **Coverage:** complete
- **Files:** 1 listed, 1 with changes left, 0 ignored

## `Order.cs` -> `Order.new.cs`

modified; language: csharp; analysis: complete; edits: 2 visible, 1 omitted, 1 mixed

```diff
…the diff body…
```

## Coverage and omissions

- `Order.new.cs`: 1 omitted edit, 2 hidden changes (whitespace=2)

Paste-ready for a pull request description or a document. The fence is always longer than the longest backtick run inside it, so no source line can break out of it, and paths are code spans whatever characters they contain. With --stats the closing Coverage and omissions section lists every file that was ignored, not compared, compared as text only or analysed in part (one side does not parse), and every file with omitted edits — or says Every file was analysed, and nothing was left out. Without it, the summary list and the status lines are left out, and the closing section appears only when a file could not be compared or was left out, naming the one and counting the other.

Was this page helpful?