Matthew Nichols
Matthew Nichols

Reputation: 5035

How can I be automatically notified if a particular file(s) in svn is altered?

In my current project we have directory with all of our third party (jQuery, dataTables, etc...) javascript files in it. A few times now we have had some developers alter these files thinking that is the only way to accomplish their tasks (they were mistaken but didn't have the experience to know it) and this has led to extra time having to be spent cleaning up.

Is there a way to "put a watch" on certain files in subversion so that we would be notified whenever they are altered?

Upvotes: 0

Views: 61

Answers (2)

rafaelxy
rafaelxy

Reputation: 322

Subversion server have some hook scripts that are triggered when some actions happen. One of the hooks is post-commit, you could this trigger to develop a script that would check if the file is equal to the last revision or something like that.

http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.reposadmin.create.hooks

Upvotes: 0

Franci Penov
Franci Penov

Reputation: 75981

If you just want to be notified, set up a post-commit hook to send you an email when someone changes something.

If you want to automatically prevent the change, set up a pre-commit hook instead.

Better yet, move the external files in a separate repository, and include them in the normal one using svn:externals. Then lock down the externals repository to RO for everybody, except people that have the right to update these (and the knowledge how to do it properly).

Upvotes: 3

Related Questions