I want to write the post commit hook to update the databases automatically on every svn commit…..
and also I want to know any other way to perform the same task rather than post commit hook?
Thanks
Naveen.
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 wouldn’t use the post-commit hook – it runs while the developer is committing to SVN, and you really want your commits to be as fast and painless as possible. That makes it hard to deal with inevitable situations where the database action is slow, or fails, or can’t connect to the database or whatever.
Instead, I’d look at setting up a continuous integration server to monitor SVN, and run whatever scripts you want to for each commit.
As for “how” – either write a native application to run the database query, passing in the parameters on the command line, or use whatever scripting language your platform supports to execute the database queries. Powershell on Windows, pretty much anything on *nix…