Re: the war on trailing whitespace
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 27, 2006, 00:45 UTC
- Message-ID
- <7vr75p4ojt.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0602261213340.22647@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 9 quoted lines
> Personally, I don't mind whitespace that much. In particular, I _suspect_ > I often have empty lines like > > int i; > > i = 10; > > where the "empty" line actually has the same indentation as the lines > around it. Is that wrong? Perhaps.
Yes, you do, and I hand-fixed one a couple of minutes ago ;-).
Regarding git-apply change, I suspect warn_on_whitespace should not squelch itself after the first one, and error_on_whitespace should not die instantly. The sample pre-applypatch hook (it was missing code to figure out where GIT_DIR was so it never worked as shipped; corrected in "master") shows line numbers of suspicious lines from the files being patched. They can be manually fixed up, and then "git am --resolved", if the integrator is in a better mood.
The error messages from pre-commit/pre-applypatch hook mimic the way compiler errors are spit out, so that it works well in Emacs compilation buffer -- doing C-x ` (next-error) takes you the line the error appears and lets you edit it.