Skip to content
/ diffr Public
forked from mookid/diffr

Yet another diff highlighting tool

License

Notifications You must be signed in to change notification settings

carenas/diffr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diffr

Overview

Reviewing changes involves reading diffs. Sometimes, a line-oriented presentation of changes is not precise enough, especially when changes involve long lines or very similar consecutive lines.

This program processes such diffs, and output them (in the console) with additional diff information on top of the unified diff format, using text attributes.

It works hunk by hunk, recomputing the diff on a word-by-word basis.

The current implementation uses Myers longest common subsequence algorithm.

Screenshots

Demo Demo Demo

Installation

Arch Linux

Install from the AUR:

git clone https://aur.archlinux.org/diffr.git
cd diffr
makepkg -si

From Source

You will need the Rust compiler installed.

git clone https://github.com/mookid/diffr.git
cd diffr
cargo install --path .

How to use it?

diffr tries to be a well behaved unix program: it reads its input from stdin and writes to stdout.

To test it:

cargo build --release
git show HEAD | path/to/diffr

To integrate it with git:

Add the following section to your .gitconfig file:

[pager]
    log  = path/to/diffr | less -R
    show = path/to/diffr | less -R
    diff = path/to/diffr | less -R

Related projects

This is improvement on the diff-highlight script distributed with git.

git itself provides both --word-diff and --color-words options to several commands.

About

Yet another diff highlighting tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%