Disallow pushing of new trailing whitespace

Geoffrey Mainland mainland at apeiron.net
Tue Aug 20 15:03:23 CEST 2013


I wasn't seriously suggesting such a hook...thus the wink.

I *am* seriously suggesting that whitespace changes not be mixed with
other changes in a given commit.

Geoff

On 08/20/2013 01:55 PM, Herbert Valerio Riedel wrote:
> On 2013-08-20 at 13:21:02 +0200, Geoffrey Mainland wrote:
>> How about a third hook that disallows commits that include
>> whitespace-only changes unless *all* changes are whitespace-only? ;)
> The other two validations were about preserving an invariant ("file has
> no tabs" & "file has no trailing whitespace") and more or less simple to
> decide; 
>
> ...whereas your suggestion seems problematic as it's difficult to know
> whether a whitespace change to a Haskell program has semantic meaning;
> for example, how should the script detect that the following whitespace
> modification...
>
> --- main.hs	2013-08-20 14:53:34.119960468 +0200
> +++ main2.hs	2013-08-20 14:53:43.295960294 +0200
> @@ -1,5 +1,5 @@
>  foo x = do
>      putStrLn "foo"
>      when x $ do
>        putStrLn "bar" 
> -      putStrLn "doo"
> +    putStrLn "doo"
>
>
> ...is actually a semantic change?
>
> Cheers,
>   hvr
>





More information about the ghc-devs mailing list