udiff:   Unix diff compact-mode parser
1 Introduction
1.1 Features
2 Installation
3 Usage examples
4 JSON structure
8.17

udiff: Unix diff compact-mode parser🔗ℹ

 (require udiff) package: udiff

1 Introduction🔗ℹ

udiff is a compact-mode diff(1) parser written in Racket.

1.1 Features🔗ℹ

2 Installation🔗ℹ

Assuming you’ve already installed Racket, run the following command to install udiff.

  $ raco pkg install udiff

3 Usage examples🔗ℹ

By default, udiff expects to receive the diff output from stdin.

  $ diff -d old-file new-file | udiff | jq

Currently, udiff is specifically built to diff TSV files. It’s in my plans to broaden the diff scope and allow for more versatile usage of this tool.

4 JSON structure🔗ℹ

The JSON output returns a JSON document structured as follows.

The object format for changes is as follows.

{
    "from": "line in the first file",
    "to": "line in the second file"
}