[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Strip trailing whitespace

From: Jean-Marc van Leerdam <j.m.van.leerdam_at_gmail.com>
Date: Tue, 6 Oct 2009 15:08:27 +0200

Hi Olaf,

2009/10/6 Olaf van der Spek <olafvdspek_at_gmail.com>:
> On Tue, Oct 6, 2009 at 12:56 PM, Simon Large
> <simon.tortoisesvn_at_googlemail.com> wrote:
>> That would have to be supported in the subversion library, like
>> svn:eol-style, and I don't think that will ever happen. It is not the
>> job of a version control system to change your files!
>
> Things like keywords also change files...
> A VCS is the central component that stores your files and as such not
> an unlogical place to do this kind of thing.
>
>> The only reason
>> svn:eol-style is there is for multi-platform support.
>
>> You could add your own trailing space stripper as part of a pre-commit
>> or start-commit hook. The problem is that in changing the files it may
>> also change the modified status one way or the other.
>
> Aren't those hooks client-side as well? Disadvantage of that is
> ensuring every client has those hooks.
>

If it is a policy to remove trailing whitespace on specific file
types, create a server side pre-commit hook that tests for the
presence of trailing whitespace and rejects the commit if it is found.

That leaves it up to the developer to properly remove the trailing
whitespace or label the file in such a way that trailing whitespace is
allowed (by setting the proper MIME type for example).

The same can be done for tab/space indentation inside files.

-- 
Regards,
Jean-Marc
--
.       ___
.  @@  // \\      "De Chelonian Mobile"
. (_,\/ \_/ \     TortoiseSVN
.   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
.   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2404070
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-10-06 15:08:43 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.