Is there anybody who has clear instructions on how to add a pre-commit hook that avoids changes to tags subdirectories?
I already searched the internet quite a bit. I found this link: SVN::Hooks::DenyChanges , but I can’t seem to compile things.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t have enough reputation to ‘comment’ on Raim’s answer above, but his worked great, with one exception, his grep pattern is wrong.
I simply used the below as my pre-commit hook (I didn’t have an existing one, you’d need to merge in that case):
The only problem with Raim’s grep pattern is that it only matched ‘tags’ if it was at the ‘root’ of your repo. Since I have several projects in my repo, the script as he wrote it allowed commits on tag branches.
Also, be sure to chmod +x as indicated, otherwise you’ll think it worked b/c the commit failed, but it failed b/c it couldn’t exec the pre-commit hook, not because the hook worked.
This was really great, thanks Raim. Much better and lighter weight than all other suggestions as it has no dependencies!