Class DiffSummary
The diff itself was behind a collapsed <details>, so the single most important fact
on a change-control screen — that a configuration change happened and roughly how big it was —
cost a click per row. Expanding every row by default is not the answer either: a page holds up
to 50 records and a config.xml diff runs to hundreds of lines, so 50 open diffs is a
screen nobody can read. The compromise is that the shape of the change is always visible and
only the body stays on demand.
Counting is purely textual and matches the format store/UnifiedDiff emits: a
--- before / +++ after header, then hunks of @@ … @@, context lines and
+/- lines. The two header lines are excluded by length (a bare --- or
+++ is not a content line), and the "diff too large to store" placeholder contains no
+/- lines at all, so it summarises as empty and the row simply shows the note.
-
Method Summary
-
Method Details
-
of
- Parameters:
diff- the stored unified diff, possibly null- Returns:
"+12 / -3 lines", or an empty string when there is nothing countable
-