Git utilities

Unified diff hunk counts

Check that text hunk bodies match their declared old and new line counts.

Your inputs

Start with an example

Your inputs stay in your browser.

Your result

Example result

How it works

Context consumes one old and one new line; deletions consume old lines and additions consume new lines.

The sample hunk has one context, one deletion and one addition: two old and two new lines.

Limits

A hunk-count check, not patch application or a complete diff validator. Binary patches are excluded; source contents, line positions and metadata are not verified.