---
name: a-plus-bracket-regex-undercounts-a-diff-by-its-blank-added-lines
description: grep -c '^+[^+]' silently drops every BLANK added line, so it under-reports a diff's insertions — and the denominator is the whole point of an absence check
metadata:
  type: feedback
---

`grep -c '^+[^+]'` is a DEFECTIVE idiom for counting a diff's added lines. The bracket requires a
character AFTER the `+`, so it drops every **blank added line**. Measured 2026-09-10 on
`a9e786b2..ef9c1599` (releases#294 diag arm): I reported **510** added lines; deployah reported
**521** raw and **516** header-excluded, and 516 is exactly the diffstat's insertion count.
Reconciled to the line, no remainder: `^+$` = 6, so **510 + 6 = 516**; `^++` = 5 (the `+++ b/...`
headers), so **516 + 5 = 521**. Three numbers, two known offsets.

Correct spelling: `git diff A B | grep '^+' | grep -vc '^+++ '`, cross-checked against
`git diff --shortstat`. Two independent derivations agreeing is the check; one regex is a claim.

**Why it mattered more than the arithmetic:** the count was the DENOMINATOR of an absence check —
"zero traceable-reqs tags across N added lines" — and per [[a-zero-from-an-absence-grep-is-a-spelling-claim]]
a zero only discharges anything against a denominator that was actually read. I supplied a
denominator produced by a regex with a blind spot, in the same message where I credited deployah for
catching a vacuous zero. The conclusion survived (zero tags under any denominator, and the detector
proved itself live by returning 1 on a commit that does carry a tag) — but the next use of that
spelling is a census where the six dropped lines are the six that matter.

**Do not smooth a figure disagreement.** deployah refused to let two numbers stand under one
finding, and that refusal is what produced the exact mechanism instead of a winner.
Kin [[a-detector-must-pass-a-control-built-from-what-motivated-it]], [[compare-at-one-layer-crlf-meter-class]].
