git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* the war on trailing whitespace
@ 2006-02-26  1:40 Andrew Morton
  2006-02-26  3:38 ` Junio C Hamano
  0 siblings, 1 reply; 41+ messages in thread
From: Andrew Morton @ 2006-02-26  1:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


It's invariably pointless to add lines which have trailing whitespace. 
Nobody cares much, but my scripts spam me when it happens, so I've become
obsessive.    Looking at Dave Miller's current net devel tree:

bix:/usr/src/25> grep '^+.*[    ]$' patches/git-net.patch | wc -l
    170

Note that this is purely _added_ trailing whitespace.  I'm not proposing
that the revision control system should care about pre-existing trailing
whitespace.

I got the quilt guys to generate warnings when patches add trailing
whitespace, and to provide the tools to strip it.  And I believe Larry made
similar changes to bk.

I realise that we cannot do this when doing git fetches, but when importing
patches and mboxes, git ought to whine loudly about input which matches the
above regexp, and it should offer an option to tidy it up.  Perhaps by
default.

Of course, this means that the person who sent the patch will find that his
as-yet-unsent patches don't apply to the upstream tree any more.  Well,
that's tough luck - perhaps it'll motivate him to stop adding trailing
whitespace.  The patches will still apply with `patch -l'.

Thanks for listening ;)

^ permalink raw reply	[flat|nested] 41+ messages in thread
* Re: the war on trailing whitespace
@ 2006-02-28  1:07 linux
  0 siblings, 0 replies; 41+ messages in thread
From: linux @ 2006-02-28  1:07 UTC (permalink / raw)
  To: git

The only language I know of where the presence of whitespace on blank
lines matters is make(1).  Even there, it's subtle.  It's okay to have
(using "cat -e" syntax)

foo : bar$
	command$
$
	command$

But there's a difference between

foo : bar$
	$

which specifies an empty command and will therefore not use a default rule, and

foo : bar$
$

which does not specify any command and so will use a default rule if one exists.


(Of course, you can also get [ \t]\n inside an arbitrary binary file, too.)

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2006-02-28  9:46 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-26  1:40 the war on trailing whitespace Andrew Morton
2006-02-26  3:38 ` Junio C Hamano
2006-02-26  5:07   ` Andrew Morton
2006-02-26 17:29     ` Linus Torvalds
2006-02-26 18:36       ` Andrew Morton
2006-02-26 20:16         ` Linus Torvalds
2006-02-26 20:26           ` Dave Jones
2006-02-26 20:31             ` Dave Jones
2006-02-27  2:50             ` MIke Galbraith
2006-02-27  9:07               ` Johannes Schindelin
2006-02-27  9:18                 ` Andrew Morton
2006-02-27 23:18                   ` Junio C Hamano
2006-02-27 23:29                     ` Peter Williams
2006-02-28  0:10                       ` Junio C Hamano
2006-02-27 23:37                     ` Andrew Morton
2006-02-28  9:13                       ` [PATCH] git-apply: war on whitespace -- finishing touches Junio C Hamano
2006-02-28  1:13                     ` [PATCH 1/3] apply: squelch excessive errors and --whitespace=error-all Junio C Hamano
2006-02-28  1:13                     ` [PATCH 2/3] apply --whitespace: configuration option Junio C Hamano
2006-02-28  9:16                       ` Andreas Ericsson
2006-02-28  9:38                         ` Junio C Hamano
2006-02-28  9:46                           ` Andreas Ericsson
2006-02-28  1:13                     ` [PATCH 3/3] git-apply --whitespace=nowarn Junio C Hamano
2006-02-28  3:26                       ` A Large Angry SCM
2006-02-28  5:08                         ` Junio C Hamano
2006-02-27 11:26                 ` the war on trailing whitespace Adrien Beau
2006-02-27 11:41                   ` Andreas Ericsson
2006-02-27 13:31                     ` Uwe Zeisberger
2006-02-27 14:10                       ` Andreas Ericsson
2006-02-27 14:31                         ` Peter Hagervall
2006-02-27 14:40                           ` Johannes Schindelin
2006-02-27 15:22                             ` Randal L. Schwartz
2006-02-27 16:08                         ` Josef Weidendorfer
2006-02-27 16:22                         ` Adrien Beau
2006-02-27 16:37                         ` Uwe Zeisberger
2006-02-27 16:41                           ` Andreas Ericsson
2006-02-27 11:55                   ` Johannes Schindelin
2006-02-27  0:45           ` Junio C Hamano
2006-02-27  2:14             ` [PATCH] apply --whitespace fixes and enhancements Junio C Hamano
2006-02-26 20:29         ` the war on trailing whitespace Junio C Hamano
2006-02-26 19:45       ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2006-02-28  1:07 linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).