All Projects → mookid → Diffr

mookid / Diffr

Licence: mit
Yet another diff highlighting tool

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Diffr

Console
OS X console application.
Stars: ✭ 298 (-11.83%)
Mutual labels:  console
Cfiles
A ncurses file manager written in C with vim like keybindings
Stars: ✭ 319 (-5.62%)
Mutual labels:  console
Linediff.vim
A vim plugin to perform diffs on blocks of code
Stars: ✭ 331 (-2.07%)
Mutual labels:  diff
Terminal Icons
A PowerShell module to show file and folder icons in the terminal
Stars: ✭ 303 (-10.36%)
Mutual labels:  console
Frontendwingman
Frontend Wingman, Learn frontend faster!
Stars: ✭ 315 (-6.8%)
Mutual labels:  console
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+6004.14%)
Mutual labels:  console
Diff2html Cli
Pretty diff to html javascript cli (diff2html-cli)
Stars: ✭ 287 (-15.09%)
Mutual labels:  diff
Towel
Throw in the towel.
Stars: ✭ 333 (-1.48%)
Mutual labels:  console
Policy Bot
A GitHub App that enforces approval policies on pull requests
Stars: ✭ 297 (-12.13%)
Mutual labels:  code-review
Static Review
✋ An extendible framework for version control hooks.
Stars: ✭ 330 (-2.37%)
Mutual labels:  code-review
Whatspup
🔳 WhatsApp chat from commandline/console/cli using GoogleChrome puppeteer
Stars: ✭ 310 (-8.28%)
Mutual labels:  console
Raptor
Web-based Source Code Vulnerability Scanner
Stars: ✭ 314 (-7.1%)
Mutual labels:  code-review
Bcal
🔢 Storage and general-purpose calculator
Stars: ✭ 329 (-2.66%)
Mutual labels:  console
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+1243.49%)
Mutual labels:  code-review
Laravel Desktop Notifier
💻 Send notifications to your desktop from your Laravel Artisan Commands. An JoliNotif wrapper for Laravel.
Stars: ✭ 333 (-1.48%)
Mutual labels:  console
Csconsoleformat
.NET C# library for advanced formatting of console output [Apache]
Stars: ✭ 296 (-12.43%)
Mutual labels:  console
Godot Console
In-game console for Godot 3.
Stars: ✭ 320 (-5.33%)
Mutual labels:  console
Differ
A simple gem for generating string diffs
Stars: ✭ 336 (-0.59%)
Mutual labels:  diff
Pgdiff
Compares the PostgreSQL schema between two databases and generates SQL statements that can be run manually against the second database to make their schemas match.
Stars: ✭ 333 (-1.48%)
Mutual labels:  diff
Cpp Project
Boiler plate template for C++ projects, with CMake, Doctest, Travis CI, Appveyor, Github Actions and coverage reports.
Stars: ✭ 328 (-2.96%)
Mutual labels:  code-review

diffr

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 outputs 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.

crates.io crates.io Build Status

Demo Demo Demo

Installation

Arch Linux

Install from the AUR:

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

Homebrew

brew install diffr

From source

You will need the Rust compiler installed.

To install the latest published version:

cargo install diffr

Alternatively, you can build the development version:

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.

One-off usage

git show HEAD | diffr

Integration with git

Add the following section to your .gitconfig file:

[core]
    pager = diffr | less -R
[interactive]
    diffFilter = diffr

Alternatively, you can run from the command line:

git config --global core.pager 'diffr | less -R'
git config --global interactive.difffilter diffr

Color customization

Use the --colors flag.

You can customize the display of diffing and common segments of added and removed lines.

For example,

diffr --colors refine-removed:background:200,0,0:foreground:white:bold

tweaks the red used for uniquely removed text;

The configuration used in the first screenshot is

diffr --colors refine-added:none:background:0x33,0x99,0x33:bold --colors added:none:background:0x33,0x55,0x33 --colors refine-removed:none:background:0x99,0x33,0x33:bold --colors removed:none:background:0x55,0x33,0x33

Display line numbers

The --line-numbers displays the line numbers of the hunk.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].