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

Re: EOL Check Hook Script?

From: Ryan Schmidt <subversion-2009a_at_ryandesign.com>
Date: Thu, 12 Mar 2009 12:26:47 -0500

On Mar 12, 2009, at 02:31, Bob Proulx wrote:

> Ryan Schmidt wrote:
>> I didn't understand your reason for not wanting to use the existing
>> eol enforcement technology that Subversion already has (setting
>> svn:eol-style).
>
> One reason is that then I would need to have these other folks working
> on the project to set up their auto-props. That is about as much
> trouble for me to get them to do as it is for me to get them to set up
> their editors with eol conventions. If I could do one successfully
> then I would be able to do the other instead. I would just set up
> their editors to be newline only and be done with it.
>
>> I would suggest that you set svn:eol-style to whatever value you like
>> best (be that native or LF or CRLF) on all files that need eol
>> enforcement. On each client, you set up auto-props to automatically
>> set that property on those types of files, by filename extension. And
>> in the server's pre-commit hook, you check that all committed files
>> with whatever filename extensions do have the property set, and if
>> not, exit and tell the user to set the property.
>
> Yes, I am well aware of that process. But I was hoping to avoid it.
> I think I would rather do it differently.

By all means. :) Nothing prevents you from writing a pre-commit hook
to enforce line ending style or any other aspect of your files. You
could use "svnlook changed" to get a list of changed files. Then for
each file whose name has a particular extension that you know to be a
text file, you can use "svnlook cat" to get the contents of the file.
You can analyze it with grep or some other tool to see if it contains
only the line endings you want.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1313704

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-03-12 18:27:48 CET

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

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