views:

247

answers:

1

Please can you explain about whitespace errors in git, what do they mean, what is 'squelching', and do I need to worry about it?

(Running msysgit, but with other users on linux).

There is already a 'definitive' answer for autocrlf here (set it to false git config --global core.autocrlf false )

A: 

Squelching is initially a function used in telecommunication to set a threshold above which a signal is or isn't alllowed through.

In your case, when you see:

warning: squelched 104 whitespace errors
warning: 109 lines add whitespace errors. 

It means: instead of displaying 100+ error messages, it warns you it should have displayed those errors (but it won't, in order to not clutter the output)

I have no definitive recommendations for whitespace policy, except from identifying why they are introduced in the first place.
If your editor doesn't convert the eol (end of lines) characters between Window and Unix, then it means it somehow add or remove automatically whitespaces, which is not always useful.

A first test (as in this blog post) is to de-activate the policy:

git config core.whitespace nowarn

or try

git config core.whitespace fix

and see if that facilitates your rebase operations.

VonC
So, something like my editor converting tabs to spaces would show as an error? (Actually, it wasn't a rebase that gave me this message, it was re-applying a stash - it didn't prevent the re-apply, but I wanted to understand the message)
Benjol
@Benjol: in this case, the 'squelch' message is there to warn you there will be trouble in future merge situations (merge, rebase, push to, pull from)
VonC