Re: Git Config

2011-08-22 Thread Smylers
Aaron Crane writes:

 Jason Clifford ja...@ukfsn.org wrote:
 
  On Sat, 2011-08-20 at 11:32 +0100, Smylers wrote:
  
   Hello. How can I make the git diff command use the -b flag (aka
   --ignore-space-change) by default?
 
  Have you tried: git config --global apply.whitespace nowarn
 
 AIUI, that's the opposite — it's about dealing with whitespace when
 applying patches, not pretending that whitespace changes don't exist
 when generating diffs.

Yes, I don't want to change what git itself does with code, just what it
shows me when I run git diff to review a change before committing it. In
particular, I want that if I've wrapped a block around some code it
doesn't show lines where the only change is in its indentation, thereby
making it harder to spot actual changes.

 My suggestion would be to alias `git d` (or similar) to `git diff -b`,
 leaving plain `git diff` unmolested.  But I realise that isn't quite
 what you asked for, Smylers.

Good idea.

It seems I could also set git.external to a script which calls diff -b,
but I can't work out if that just gets used by git diff or would also be
invoked by any internal operation where git needs a diff for its own use
(which I probably don't want, and might mess things up).

Smylers


Re: Git Config

2011-08-20 Thread Gianni Ceccarelli
On 2011-08-20 Smylers smyl...@stripey.com wrote:
 Hello. How can I make the git diff command use the -b flag (aka
 --ignore-space-change) by default?

There does not seem to be a way:

- no support in config
  
http://git.kernel.org/?p=git/git.git;a=blob;f=diff.c;h=d3d8daec77142bc6a67aacdc2e62ee522ddf12db;hb=HEAD#l137

- aliases can't modify built-in commands

-- 
Dakkar - Mobilis in mobile
GPG public key fingerprint = A071 E618 DD2C 5901 9574
 6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

===  ALL CSH USERS PLEASE NOTE  

Set the variable $LOSERS to all the people that you think are losers.
This will cause all said losers to have the variable
$PEOPLE-WHO-THINK-I-AM-A-LOSER updated in their .login file.  Should
you attempt to execute a job on a machine with poor response time and a
machine on your local net is currently populated by losers, that
machine will be freed up for your job through a cold boot process.


Re: Git Config

2011-08-20 Thread Smylers
Gianni Ceccarelli writes:

 On 2011-08-20 Smylers smyl...@stripey.com wrote:
 
  Hello. How can I make the git diff command use the -b flag (aka
  --ignore-space-change) by default?
 
 There does not seem to be a way:
 
 - no support in config
   
 http://git.kernel.org/?p=git/git.git;a=blob;f=diff.c;h=d3d8daec77142bc6a67aacdc2e62ee522ddf12db;hb=HEAD#l137
 
 - aliases can't modify built-in commands

Oh. Thanks for looking that up.

Given there's a mechanism for specifying default options in ~/.gitconfig
it's curious that it only works for some of them.

And it seemed so unlikely that Git can't do something that CVS can, that
I presumed it was just me not being able to find it!

Cheers

Smylers
-- 
http://twitter.com/Smylers2


Re: Git Config

2011-08-20 Thread Jason Clifford
On Sat, 2011-08-20 at 11:32 +0100, Smylers wrote:
 Hello. How can I make the git diff command use the -b flag (aka
 --ignore-space-change) by default?

Have you tried: git config --global apply.whitespace nowarn





Re: Git Config

2011-08-20 Thread Aaron Crane
Jason Clifford ja...@ukfsn.org wrote:
 On Sat, 2011-08-20 at 11:32 +0100, Smylers wrote:
 Hello. How can I make the git diff command use the -b flag (aka
 --ignore-space-change) by default?

 Have you tried: git config --global apply.whitespace nowarn

AIUI, that's the opposite — it's about dealing with whitespace when
applying patches, not pretending that whitespace changes don't exist
when generating diffs.

My suggestion would be to alias `git d` (or similar) to `git diff -b`,
leaving plain `git diff` unmolested.  But I realise that isn't quite
what you asked for, Smylers.

-- 
Aaron Crane ** http://aaroncrane.co.uk/