You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Chris Chiasson <ch...@chiasson.name> on 2006/07/27 04:35:05 UTC

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

Hi,

I am new to Subversion and to version control in general. Please don't
hurt me :-)

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

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.

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

Posted by Chris Chiasson <ch...@chiasson.name>.
Ryan,

Thank you for this advice. My Subversion situation changed when I
moved to Eclipse with the Mathematica plugin; I am now able to keep
many more source files as plaintext, so I haven't tried out your
suggestion yet. I will likely try it in the future, but I need to
thank you now because I am unsubscribing from the mailing list.

Thank you.

On 7/27/06, Ryan Schmidt <su...@ryandesign.com> wrote:
> 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.
>
> http://svn.haxx.se/users/archive-2006-06/0853.shtml
>
> Just remember that you must not attempt to modify the data in the
> incoming transaction or the world will end.
>
>
>
>
>


-- 
http://chris.chiasson.name/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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.

http://svn.haxx.se/users/archive-2006-06/0853.shtml

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