All Projects → da-x → Fancydiff

da-x / Fancydiff

Licence: other
Colorful Git diffs for terminal and web, including source syntax highlighting

Programming Languages

haskell
3896 projects

Fancydiff

Build Status

Fancydiff is a diff coloring wrapper for Git, under Linux or MacOS X, that supports both intra-line diffs, and source code syntax highlighting.

This similar to what you see on Github, but instead it is done in the user's console.

Download and install

Linux

First make sure that you have a terminal program that supports 24 bit True Color (see this gist).

Ubuntu users of URxvt can install from my build of urxvt on Launchpad,

Fedora/CentOS users can use my patched builds of URxvt installable from Copr.

Latest binaries of Fancydiff can be installed on major distributions.

On Fedora 22 onwards:

sudo dnf copr enable alonid/fancydiff
sudo dnf install fancydiff

For EPEL/CentOS/Red Hat 7, visit Copr.

On Ubuntu:

sudo add-apt-repository ppa:alonid/fancydiff
sudo apt-get update
sudo apt-get install fancydiff

You can also visit Fancydiff's PPA in Launchpad.

MacOS X

Download a test release or a nightly of iTerm2, which supports 24-Bit True Color ANSI codes. Then, do the following:

brew install https://raw.githubusercontent.com/da-x/fancydiff/brew-lastest/fancydiff.rb

Or, compile from source

Follow the building instructions.

Git configuration

With fancydiff in $PATH you can use the setup command to modify the Git configuration.

fancydiff setup [--local] [--aliases]

More details here about how the Git configuration is modified to enable Fancydiff.

Using with less, independent of Git

Add the following line to one of your shell initialization scripts:

export LESSOPEN="|fancydiff file %s -e"

Limitations

  • Too few source code languages are supported (currently: C/C++, Haskell, Python, Java, JavaScript, Go).
  • Some small original coloring features from Git itself are missing.
  • Some special Git modes don't use the pager (e.g. git checkout -p, in which Fancydiff is not presently activated.
  • 3-way diff is not yet supported.

Contribution and bug reports

Everyone is welcome to contribute and report issues here via Github!

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