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

Re: svn:keywords ... a plea

From: Ryan Schmidt <subversion-2008a_at_ryandesign.com>
Date: Mon, 24 Mar 2008 16:46:12 -0500

On Mar 24, 2008, at 16:31, Graeme Vetterlein wrote:

> In summary:
>
> 1: Adding keywords is (almost) always a GOOD IDEA ... just need
> to take care in a few cases
> 2: Getting keywords to work in most version control systems is
> simple
> 3: In SVN it is very hard:
> i: Requires a special setting on each file
> ii: Setting is 'free format' so cannot be syntax checked by
> svn
> iii: Automatic setting of option cannot be done on
> repository (i.e. project) basis
> iv: Setting of option on client side:
> a: Mostly missing from documentation
> b: Not given default values in generated files (like
> many other options)
> 4: Very few files I've found in SVN have the keywords set
> (correctly) (this is MY experience ... many 10's of users)

I haven't used other version control systems so I don't know first-
hand how Subversion's keyword handling compares.

Yes, auto-props are a client-side config setting. But you can install
a pre-commit hook on the repository to reject any commit that does
not conform to your policy, be that policy of certain keywords on
certain types of files or anything else. If you reject a commit, you
can explain to the user why (on stderr) and even direct them to a pre-
made config file somewhere on a server of yours that they can download.

Make sure you do not define an auto-props rule like "* =
svn:keywords=Id" (to set svn:keywords to Id on all files) because
this would also apply to binary files, on which keywords are possibly
inappropriate and could result in corruption and data loss. Set
automatic properties only on filename extensions which are text
files. (There are fixed-width keywords, however, which can be used
probably safely, for example, in Word documents and some other binary
formats which contain textual data.)

I think svn could check the syntax of svn:keywords to ensure it's
valid. It just doesn't. Again, you could check the syntax of
svn:keywords in a pre-commit hook, and reject the commit if the
syntax isn't valid.

Book suggestions should be sent to the svnbook mailing list. See the
bottom of http://www.svnbook.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-03-25 11:45:35 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.