gregsexton / gitv

gitk for Vim.
938 stars 59 forks source link

Diff results don't strip color correctly #8

Closed amcfague closed 13 years ago

amcfague commented 13 years ago

I'm not sure if this is related to fugitive or gitv, but when viewing commits in gitv, the patches do not correctly strip out color or display color:

^[[1mdiff --git a/setup.py b/setup.py^[[m
^[[1mindex c323a41..2de261b 100644^[[m
^[[1m--- a/setup.py^[[m
^[[1m+++ b/setup.py^[[m
^[[36m@@ -31,7 +31,7 @@^[[m ^[[msetup(^[[m

(Obviously, special characters converted to text)

This is on git 1.7.4.1, and the HEAD of master for both vim-fugitive (f112f9b830a8f42375183c9a47965270ae8b3ae4) and gitv (efe940452691855b99db7d4fe204661ff0643f82).

Andrew

gregsexton commented 13 years ago

Hi Andrew,

I'm afraid this is a fugitive issue really. gitv calls fugitive to display (nearly all) of the possible diffs. The diffs that gitv produces actually include the --no-color option for just this reason. I suggest you raise this issue on the fugitive page and in the meantime disable color output for diffs. Fugitive will take care of coloring the diff for you. I have actually mapped the git alias: d = diff --color and find this takes care of the issue completely in the command line.

Closing for now. Will reopen if you can demonstrate a case that is gitv specific rather than fugitve.

Thanks,

Greg

amcfague commented 13 years ago

That's great; thanks for your fast response, too! I'll see if I cant' trace down what's going on--a coworker running the same versions of vim-fugitive and gitv doesn't have this issue, but he's also using git 1.7.0--so maybe something changed there.

Thanks again!

gregsexton commented 13 years ago

You're welcome. You should try comparing your .gitconfig files to see if you have color set to always.

amcfague commented 13 years ago

That was actually it. I had it turned on for some other scripts I had installed, where it wouldn't always highlight correctly. So thanks! Hopefully this will help someone else, too. ;)

Andrew