0.0
No commit activity in last 3 years
No release in over 3 years
Syntax highlights content from a git diff
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

~> 1.1.0
 Project Readme

DiffHighlight

(C) John Mair (banisterfiend)

Applies syntax highlighting to a git diff. Use as follows:

git diff | diff_highlight | less

Output:

img

Features

  • Makes its best guess at the language appearing in the diff and uses appropriate highlighter
  • Supports Ruby, Javascript, C, YAML, Rakefiles, CSS, HTML, etc
  • Supports multiple languages in the same diff
  • Supports streaming input and output

How to use

This gem provides the diff_highlight executable. Just install the gem and the executable should be available :) Use as follows: git diff | diff_highlight | less

Or setup a git alias:

In ~/.gitconfig:

[alias]
    diffc="!f() { git diff $@ | diff_highlight | less; }; f"

And use like so:

git diffc HEAD~2

License

The gem is available as open source under the terms of the MIT License.