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

Re: svn:keywords on every file in repository

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Sun, 2 Nov 2008 15:39:52 -0600

On Nov 2, 2008, at 14:39, Ryan Schmidt wrote:

> On Nov 2, 2008, at 10:41, vinay i wrote:
>
>> I want a default set of keywords to be set on every file in the
>> subversion repository. So that whenever I create a new file, it
>> should automatically set svn:keywords to say "Author Id URL" etc.
>> Is there a way I can do this?
>
> Yes.
>
> 1) Set up each client's config file to enable automatic properties.
> Make sure the line "[auto-props]" exists in the config file and is
> not commented out (does not have a "#" in front of it). And then
> add lines for each type of file where you want properties to be
> added. For example you might add lines like these:
>
> *.[Cc][Ss][Ss] = svn:eol-style=native;svn:keywords=Author Id
> URL;svn:mime-type=text/css
> *.[Gg][Ii][Ff] = svn:mime-type=image/gif
> *.[Hh][Tt][Mm] = svn:eol-style=native;svn:keywords=Author Id
> URL;svn:mime-type=text/html
> *.[Hh][Tt][Mm][Ll] = svn:eol-style=native;svn:keywords=Author Id
> URL;svn:mime-type=text/html
> *.[Jj][Pp][Ee][Gg] = svn:mime-type=image/jpeg
> *.[Jj][Pp][Gg] = svn:mime-type=image/jpeg
> *.[Jj][Ss] = svn:eol-style=native;svn:keywords=Author Id
> URL;svn:mime-type=text/javascript
> *.[Pp][Nn][Gg] = svn:mime-type=image/png
> *.[Tt][Xx][Tt] = svn:eol-style=native;svn:keywords=Author Id URL
>
> Filenames are matched case-sensitively, in case you're wondering
> about the ugly way that I've specified filename extensions on these
> lines.

I meant to add:

2) If you want to guarantee that these properties are added on each
and every file of the above types, write a pre-commit hook to reject
any commit that doesn't match these guidelines. This will catch those
users who forgot to set up their config files. In the error message
you print in the pre-commit hook, you can inform the user how to set
up their config file properly, or point them to the URL of a pre-made
config file they can download and use.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-11-02 22:40:22 CET

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