Try running:
git config --global color.ui auto
This will activate colorful output for all git commands (in particular for `git diff' too).
Then, when you run `git diff' from a terminal you will see whitespace errors (eg. trailing whitespace) highlighted with a red background.
Hope it helps, Octavian
Octavian Voicu wrote:
Try running:
git config --global color.ui auto
This will activate colorful output for all git commands (in particular for `git diff' too).
Then, when you run `git diff' from a terminal you will see whitespace errors (eg. trailing whitespace) highlighted with a red background.
I've got to try that.
Thanks Octavian.
James McKenzie
On 08/30/2010 12:34 AM, Octavian Voicu wrote:
Try running:
git config --global color.ui auto
This will activate colorful output for all git commands (in particular for `git diff' too).
Then, when you run `git diff' from a terminal you will see whitespace errors (eg. trailing whitespace) highlighted with a red background.
Hey, that's pretty cool.
Can someone add this here http://wiki.winehq.org/GitWine#head-b20b05157175835751686365f9818ae978ceca23 ?
Thanks for the tip Octavian !
On Mon, Aug 30, 2010 at 2:11 PM, GOUJON Alexandre ale.goujon@gmail.com wrote:
Hey, that's pretty cool.
Can someone add this here http://wiki.winehq.org/GitWine#head-b20b05157175835751686365f9818ae978ceca23 ?
Thanks for the tip Octavian !
Well, that's what I love about git the most -- the pretty colored output :P
Glad I could help.
On Mon, Aug 30, 2010 at 2:11 PM, GOUJON Alexandre ale.goujon@gmail.com wrote:
Can someone add this here http://wiki.winehq.org/GitWine#head-b20b05157175835751686365f9818ae978ceca23
Added this to the wiki. Can't find a way to create links to sections within the page though; the ids of the sections are regenerated on each save.
Does not work for me :crying: I voluntary added trailing space to my file. Nothing appears in red. I obtain in white and black testcooperativelevels_normal();ESC[m ESC[32m+ESC[mESC[32m testcooperativelevels_normal_other_ddraw();ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m releasedirectdraw();ESC[m
I use kconsole. Maybe it is the problem ??
Thanks for the advices
A+
David
2010/8/30 Octavian Voicu octavian.voicu@gmail.com
Try running:
git config --global color.ui auto
This will activate colorful output for all git commands (in particular for `git diff' too).
Then, when you run `git diff' from a terminal you will see whitespace errors (eg. trailing whitespace) highlighted with a red background.
Hope it helps, Octavian
On Mon, Aug 30, 2010 at 9:25 PM, David Adam david.adam.cnrs@gmail.com wrote:
Does not work for me :crying: I voluntary added trailing space to my file. Nothing appears in red. I obtain in white and black testcooperativelevels_normal();ESC[m ESC[32m+ESC[mESC[32m testcooperativelevels_normal_other_ddraw();ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m ESC[32m+ESC[mESC[41m ESC[m releasedirectdraw();ESC[m
I use kconsole. Maybe it is the problem ??
Something that starts with ESC[ is an escape sequence, it clearly shows that git is coloring the output, but your terminal isn't interpreting this.
I also use kconsole (konsole actually, KDE terminal emulator right?).
I see two possible causes:
1. You set color.ui to always and you're using less or another pager that doesn't support color. You don't need to use a pager in git diff. Normally, if you set color.ui to auto (or true), then color escape sequences are only enabled when output is a terminal (not a pipe or file).
Instead of `git diff | less' just use `git diff'. If you really want to use less, `git diff | less -r' should work with colors (-r enables interpreting color escape codes in less).
2. Your terminal is not properly configured and colors don't work. Do you have colors in other commands, like in ls?
Maybe this helps: https://bbs.archlinux.org/viewtopic.php?pid=511623
I have $TERM set to xterm. What distribution are you using? Maybe you can google for an answer on how to configure your terminal emulator to work with colors.
Octavian
On 08/30/2010 05:44 PM, Octavian Voicu wrote:
- You set color.ui to always and you're using less or another pager
that doesn't support color. You don't need to use a pager in git diff. Normally, if you set color.ui to auto (or true), then color escape sequences are only enabled when output is a terminal (not a pipe or file).
Instead of `git diff | less' just use `git diff'. If you really want to use less, `git diff | less -r' should work with colors (-r enables interpreting color escape codes in less).
Git automatically invokes a pager, as given by your 'core.pager' setting (see 'man git-config'). It defaults to 'less'. If you're not getting color, check your LESS environment variable. Unset it to use Git's default settings (which should work with color escape sequences), or set it to something like "-R". See 'man less' for more options, obviously.
If the above all seems correct, try a different or newer terminal emulator to help diagnose the problem.
Andrew
I think you want these to show up in your editor while writing the code, not after the fact. "set list listchars=tab:»·,trail:·" for vim, but I'm sure any other half-decent editor will have equivalent functionality.