subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Schmidt <>
Subject Re: howto limit filetypes
Date Tue, 02 Feb 2010 15:49:01 GMT
On Feb 2, 2010, at 09:42, Marco wrote:

> Could you give me an example on how to implement this control so that
> users can not commit particular filetypes?

In the pre-commit hook, you are given the path to the repository and the transaction number.
You can use these to call "svnlook" to see what's in the transaction. If you just want to
check filenames extensions, then "svnlook changed" tells you the names of every changed file;
if any listed filename extension matches one of your file extensions that aren't permitted,
exit with a nonzero status code to terminate the commit. If you want to get more involved
and actually check the contents of files, "svnlook cat" can retrieve the individual files
from the transaction which you can then inspect as needed.

View raw message