[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: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 06 Oct 2009 14:37:16 +0100

Olaf van der Spek wrote:
> Would it be possible to strip trailing whitespace/lines on commits?
> It's handy as some editors do and some don't strip this and it results
> in unnecessary differences.
> It could be based on both a setting and the presence of svn:eol-style.

It is possible to write a pre-commit hook to CHECK for this and reject
the commit, but I think you want to automatically EDIT the source files.
This would have to be done on the client side. Although Subversion
clients support changing the End-Of-Line style, further modifications
such as removing white-space are really beyond the scope of a
version-control tool and would best be handled by other means, such as
encouraging users to configure their editors to display or remove such
white-space (see <http://vim.wikia.com/wiki/Remove_unwanted_spaces> for
example), provide a "clean the source files" function in your project's
Makefile (if applicable), etc.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404087
Received on 2009-10-06 15:37:41 CEST

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

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