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

Re: repository global mimi-types

From: Ryan Schmidt <subversion-2006d_at_ryandesign.com>
Date: 2006-12-06 23:53:21 CET

On Dec 6, 2006, at 16:05, Peter Kennard wrote:

>
> Yes, I'm a newbie - used CVS before :)
>
> I want to implement repository global mime-types so I don't get
> unexpected EOL problems across platforms.
>
> There is a huge list of suffi that are "text" and I would like to
> somehow enforce this automaticly on so when a user adds a .java
> (.cpp .c .h .hpp .txt ...) file (etc) it is registered as text with
> no explicit action required by the user.
>
> ie: there a way to specify this globally for an entire repository
> or recursive for an entire subtree?
>
> A search indicates this may not be possible (I can't believe this
> was overlooked in the initial design :)
>
> Is it?
>
> (The same also would be desirable for other properties like
> ignoring all ".o" files in a subtree by default :)
>
> Can it be implemented using any of the hook scripts (properly?)

Line endings are not controlled by mime types, but instead by the
svn:eol-style property. Regardless of mime type, you can set the
svn:eol-style property to indicate that you would like Subversion to
force the line endings to LF, CR, CRLF, or whatever the native
encoding of the client is at checkout time. If you do not specify the
svn:eol-style property, no end of line conversion is done by
Subversion. This is the default, because it should be the default for
a revision control system to keep the files you give it, not mangle
them in some possibly irreversible way.

You must not set the svn:eol-style property on binary file types such
as images or they will become corrupted.

You can use the client-side Subversion config file to say that files
matching certain extensions should automatically receive certain
properties with certain values, such as svn:mime-type and svn:eol-
style. This feature is called auto-props (automatic properties) and
is described in the book at http://svnbook.org

This is a client-side thing, not a server-side thing. If you want to
enforce this kind of thing at the server side, the recommended thing
to do is to install a pre-commit hook which rejects the commit of any
items that do not have the properties you require.

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 6 23:54:16 2006

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.