git, whitespace errors, squelching and autocrlf, the definitive answers

后端 未结 3 1572
野的像风
野的像风 2020-12-13 08:49

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 u

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 09:22

    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.

提交回复
热议问题