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

Re: svn config file and mime types

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Wed, 22 Oct 2008 22:00:59 -0500

On Oct 22, 2008, at 21:35, Bill Hoffman wrote:

> Ryan Schmidt wrote:
>
>> You are welcome to put that file or any other file into your
>> repository and instruct your users to run "svn up" on the config
>> directory on occasion.
>
> Sure, but that is leaving the update as something each user has to
> remember to do. Why not make it part of the process?
>
>>> Right now we have a wiki entry that has a list of mime types that
>>> you have to copy into your config file. Almost without fail each
>>> new user forgets or mis-configures the file. Then things become
>>> a mess.
>>
>> But you have a pre-commit hook that ensures things that come into
>> the repository have the right properties, yes? And if not, it
>> prints an error message to the user? The message to the user can
>> tell them what to do to fix it, be that manually copying data from
>> a wiki page into their config file or running "svn up" on their
>> config directory.
>
> Yes, I do, but here is what always happens.
>
> 1. new users gets access to repository.
> 2. new user tries to add lots of files (say 100's )
> 3. new user gets tons of errors from the pre-commit hook
> 4. I tell user to fix config file
>
> Also, the process for getting the config file in the right place is
> different for each install of svn (Mac,Linux, and Windows).
>
> I guess my main point is that this is a project decision and not an
> individual user decision. The pre-commit hook can prevent them
> from checking in stuff that we don't want in the repository. But
> why stop at prevention. Why not just do it for them? By having
> the pre-commit hook on the repository, I am saying that I will not
> allow files without mime types set. So, why make the user do
> extra work? Why not have a way for the project to define a
> configuration file that affects all new files in the project?

It's a long-standing feature request:

http://subversion.tigris.org/issues/show_bug.cgi?id=1974

> Or is there a way for the pre-commit hook to set the mime types if
> they are not already set?

Not easily. You could write a post-commit script. The server would
have to maintain its own working copy, and after every commit, update
that working copy, set the MIME types as you want them, and do a
second commit. And then the person who did the first commit would
have to know to immediately update their working copy to receive
those property changes. Not ideal. IMHO it's preferable to teach the
developers to set the properties correctly before committing.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-23 05:01:24 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.