How to use Unified Patch Inspector
- Paste an ordinary unified patch with file headers and hunks, or choose one UTF-8 diff/patch file to replace the text.
- To inspect without a source preview, clear both Source text and File path to preview. Read the file, addition, deletion and hunk counts.
- For a preview, enter the exact original source. A multi-file patch also needs a path identifying one old or new file section; headers with a/ or b/ are shown without that prefix.
- Inspect the resulting text and download patched-preview.txt when a preview succeeds. No file on your device is modified.
Example: Unified Patch Inspector
Replace Old line with New line in greet.txt using exact three-line source context.
Options
- Patch input
- A chosen UTF-8 .diff or .patch file replaces the pasted patch. Ordinary unified file headers and complete, correctly counted hunks are required; binary and combined diffs are refused.
- Exact-context preview
- The source must match old/context lines at the declared positions, including final-newline state. There is no fuzzy search for a nearby match. A failed comparison returns a conflict instead of a guessed output.
- Selecting a file
- For multiple file sections, enter an exact old or new path that identifies one section. A new-file patch needs empty source. Clear both source and path when you want counts without applying any preview.
Supported inputs and limits
- Pasted patch up to 100,000 characters, 2,000 lines, 50 file sections and 200 hunks.
- A chosen UTF-8 patch file is limited to 100,000 bytes.
- Preview source accepts 100,000 characters and 10,000 lines; a preview path accepts 240 characters.
- Malformed counts, overlapping or out-of-order hunks, invalid final-newline markers, combined diffs and binary patches are refused.
- No fuzzy matching, commands, filesystem writes or code execution occur.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
A hunk describes both versions
Hunk headers declare old and new ranges. Context lines occur in both versions, minus lines belong to the old source and plus lines belong to the new source. Counts must agree with those lines before an exact-context preview can be trusted.
Questions about Unified Patch Inspector
Does this run git apply or patch?
No. The page reads the supplied text and compares hunk context locally. It does not launch a command or change your project files.
Why does a valid-looking hunk conflict?
The supplied source may differ from the patch's expected lines or final line ending. Exact-context preview deliberately avoids guessing a new position for unmatched text.
Can it inspect binary or combined diffs?
Those forms are outside the stated ordinary unified-patch support. A refusal means this preview cannot interpret the patch; it is not a verdict on whether another patch engine could use it.
What should I check before using a preview?
Confirm the intended path, original source and every changed line. A matching hunk does not establish that the code change is correct or safe to execute.