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

Re: On commit, svn server to change line ending to unix style for .sh files.

From: David Weintraub <qazwart_at_gmail.com>
Date: Sat, 6 Sep 2008 22:52:28 -0400

Take a look at the "svn:eol-style" property. That allows you to
specify the line ending for a particular file.

If your goal is to make sure all files that end in *.sh must have this
property, you'll need to write a pre-commit hook script that allows
you to do this.

I do have such a script written in Perl, and will be happy to send it
to you if you'd like. It's part of a script that also verifies write
authorizations, protects tags from changes, and even allows you to
prevent people from creating files that contain invalid characters.

By the way, the pre-commit hook script will prohibit a commit if a
*.sh doesn't have the svn:eol-style property set to "LF", but won't
automatically add the svn:eol-style property to the file. You can't
really do this via server side. However, you can do this via the
autoproperties in your config file. I setup a company wide config
file, and after a few rejected commits, people are using it.

Properties: <http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.advanced.props>
Autoproperties Config:
<http://svnbook.red-bean.com/en/1.4/svn.advanced.confarea.html#svn.advanced.confarea.opts.config>

--
David Weintraub
qazwart_at_gmail.com
On Wed, Sep 3, 2008 at 3:31 PM, Fu-Tung Cheng <futung.cheng_at_yahoo.com> wrote:
> Hi,
>
> I would like the server to store files with the extension .sh as unix style line endings even if those files are written on windows and committed from windows.
>
> When I checkout on windows the .sh files should be in unix format as I'd never want them in dos format.
>
> Is there a way to set this on the server side?
>
> Thank you,
>
> Fu-Tung
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: users-help_at_subversion.tigris.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-07 04:52:42 CEST

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.