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

Re: checking certain files before commit with an external utiltiy (newbie)

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-07-27 12:14:59 CEST

On Jul 27, 2006, at 06:35, Chris Chiasson wrote:

> Is there something for Subversion that can check all files of a
> particular type by calling an executable on them before allowing the
> commit?

Yes, you can do it in a pre-commit hook.

> Background:
> Mathematica notebooks have cached data that drastically changes even
> if the actual edits to the code are small. A utility exists to strip
> this cache. Another utility exists to detect the presence of cached
> data in a notebook:
> http://www.itwm.fhg.de/as/asemployees/wichmann/rmnbcache.html
> http://www.itwm.fhg.de/as/asemployees/wichmann/testnbcache.html
> I have searched your mailing list read and about half of the book
> _Version Control with Subversion_ to determine if there is an easy way
> to use this testnbcache utility to deny then commit if any of the
> notebooks have cache data. The mailing list search was ineffective,
> probably because the keywords I tried are common on this list in
> contexts other than the one I need.
> From the book: Hooks do not appear to directly pass the names of the
> committed files as arguments to the hook scripts, so I would need
> another way to get the (space separated) list of committed files.

You're right, the hook isn't told the names of the files, because
it's a bit more involved than that. Some files or directories could
have gotten added, modified, deleted, moved -- a bit much to
represent on the command line. Instead, the hook is given the
transaction number, with which you can run svnlook to get whatever
information you wanted.

Someone recently posted a bash script used to do syntax or stylistic
checks on committed Java files. Perhaps you can use that as a basis
for building in your checks on your Mathematica files.


Just remember that you must not attempt to modify the data in the
incoming transaction or the world will end.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jul 27 12:16:35 2006

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