×

Unified-Diff Format Overview

This parser supports the core GNU diffutils “unified” format:

--- path/to/oldfile [timestamp]
+++ path/to/newfile [timestamp]

@@ -origStart,origCount +newStart,newCount @@ optional section
␣ context line
- deletion line
+ addition line
      

Notes on metadata you might encounter:

  • diff --git a/... b/..., index <hash>..<hash>
  • Mode changes: old mode 100644, new mode 100755
  • Renames, binary diffs, combined (3-way) hunks, fuzzy offsets.

Unsupported lines (Git headers, mode changes, etc.) are skipped with a WARN in the log. Any context or deletion mismatch becomes an ERROR.