Crates.io | pratdiff |
lib.rs | pratdiff |
version | 0.1.5 |
source | src |
created_at | 2024-06-09 21:28:57.175297 |
updated_at | 2024-06-26 17:28:05.288272 |
description | A colorfull diff tool based on the patience diff algorithm |
homepage | |
repository | https://github.com/fowles/pratdiff |
max_upload_size | |
id | 1266633 |
size | 53,728 |
A diff tool that provides line and token level colorization.
Based on the Patience Diff algorithm described by Bram Cohen and then expanded upon by James Coglan in two blogs posts (algorithm and implementation).
pratdiff
?Use cargo install pratdiff
. You probably want to get cargo
from
rustup
or
brew
.
The --completions
flag takes a shell and outputs a completion script.
eval "$(pratdiff --completions=bash)"
pratdiff --completions=fish | source
Cause I wanted a learning project and this seemed like a reasonable one.
pratdiff
?I wanted to insert an "r" into patdiff
, and I kind of like "prat" as an oddly
out of date insult.
The way that token level diffing uses the same algorithm as the line level diffing is pretty cool in my mind. I didn't think going into it that I would structure it that way and it all kinda just fell out.
Also, I learned that the tiny extension on patience diff I made to use non-unique lines if unique ones fail is a known algorithm called "histogram diff".