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

Automatically run script on checkout - Possible feature request?

From: Ken Miller <klm_at_shetlandsoftware.com>
Date: 2004-09-01 23:17:56 CEST

I have an interesting problem with a possibly interesting feature request.

For the project I'm working on, I have a grammar definition file for a
language. For obvious reasons, the grammar file is managed by svn, but
the generated parser is not. The problem is that when the library tree
is checked out, the generated parser file will not be present, since
it's not managed by svn (and I don't want it managed by svn)

I'm wondering if this might not be a feature that would prove useful to
others. Here's what I'm thinking:

    svn propset svn:checkoutscript name-of-script-with-optional-args
file-or-dir ...

Then, after svn checks out the directory, it inspects the properties for
the directory and each file contained therin. For each object
containing the 'checkoutscript' property, svn executes the pointed-to
scripts in the directory where the property was configured. In my case,
I have a Makefile which takes care of running the parser generator. So,
I would do something like this:

    svn propset svn:checkoutscrript make .

'make' would then be executed in the directory where the property was
set. In this case I set the script to execute at the directory checkout
level since I need both the Makefile *and* the grammar file to both be
present before make executes. You could also set this property at the
file level. Might not make as much sense at the file level tho.

There could be security issues with this solution, since the script
would be executed as yourself - if you're not careful, you could do some
serious damage.

I think in the meantime I'll have to check in the generated code, but it
would be nice to be able to manage the code in a cleaner method.

I don't think this feature already exists - I've looked at the hook
scripts, and current properties don't seem to address my requirements.
I've also done a search of the mailing list archives, but was not
successful in finding any hits. Could have been searching for the wrong
thing, tho.

Thoughts? I agree that this is a pretty specific problem that I could
easily solve by checking in the generated file. However, think about
other ways this could be used:

    - you have XML-based documentation - check it out, svn automatically
generates your documents for you
    - auto-compile libraries on checkout

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 2 00:44:48 2004

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