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
Yes, you can do it in a pre-commit hook.
> 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:
> 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: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Thu Jul 27 12:16:35 2006