I want to create a pre-commit hook in SVN (i.e. .bat file for Windows) that checks for empty log messages. Moreover, I want to target this check only for a particular folder in SVN.
Can anybody help regarding the same?
Regards,
Ruhee Jaiswal
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.
If you’re fine with TortoiseSVN, you could enter a client-side hook there.
TortoiseSVN passes the following parameters to the pre-commit hook:
where the interesting one is
PATH:So, when your hook is called (could be in any language btw), do the following steps:
MESSAGEFILE. If there’s a comment inside, everything is fine, return successful from the script (I don’t remember whether success is indicated by 0 or !0, just give it a try)MESSAGEFILEis empty, browse through the filePATHand see if there are affected elements in that. If so, return an error; otherwise return success.