p-bxlq
Last Updated: February 25, 2016
·
1.988K
· magnetikonline
Df1412e1775840374894798d5ed9a7ea

Add some color to your diff output

Recently I have needed to mess with Subversion to get some day to day work done and probably the biggest gripe vs. Git (apart from obvious branching issues) has been the lack of color output when viewing diffs.

Picked this up along the way, pipe the patch file output of svn diff into vim, like so (as an alias):

alias svndiff='svn diff -x --ignore-all-space | view -c ":set filetype=diff" -'

set filetype=diff ensures vim treats what input it gets as a patch (sometimes it gets the auto-detect a little wrong I have found).

Added bonus, you can easily browse/search the patch with the usual vim controls. Of course variations on this pro-tip should work with anything in your utility belt that outputs patch files.

Say Thanks
Respond

2 Responses
Add your response

1055
D54f65ad3ff9ee1c9c033a403d4b5f9f

Git diff has color git diff --color=always. Likewise you can use vim as the diff tool (shameless plug) http://www.youtube.com/watch?v=hb5RVnOda2o&feature=plcp

EDIT: It seems I misread the post as if git was the one lacking color

over 1 year ago ·
1059
Df1412e1775840374894798d5ed9a7ea

@shawncplus lol - all good :D thx for the vid, will check it out!

over 1 year ago ·
Filed Under