问题
What I did - and What is the Issue
I've added directory in which few files are present in svn:
$ svn add ABC (ABC is directory)
A ABC
A ABC/file_1
A ABC/file_2
A ABC/file_3
then I did -
$ svn ci -m "some comments" ABC
Adding ABC
Adding ABC/file_1
Adding ABC/file_2
Adding ABC/file_3
Transmitting file data..svn commit failed details follows
svn commit blocked by precommit hook exit code3 with output
Now I am not able to commit, and I dont know how to do it successfully. Can you help me pls. Thanks.
回答1:
You did nothing wrong.
The problem is with the pre-commit hook. For some reason, the pre-commit hook is stopping your commit from completing. This is the purpose of a pre-commit hook: To stop a transaction from completing if its violating some site specific policy.
There are no standard pre-commit hooks. They have to be implemented by the site. Many sites write their own for various reasons. Some use various standard pre-commit hooks. So, you'll have to find the person who is responsible for your Subversion repository and ask about the pre-commit hook, what it's suppose to do, and why would it reject your particular transaction.
Normally, the author of the pre-commit hook is kind enough to give you a reason. (Like you don't have permission to add directories or the repository is locked down for some reason). However, it looks like the person who did your pre-commit hook failed to give an error message of any sort which makes it impossible to determine what could be wrong. Very likely, there's an error in the pre-commit hook itself, and it's simply not completing.
Have the site that uses the pre-commit hook modify it, so it always gives you an error message when it fails. If a pre-commit hook writes output to STDERR, it will print out that information if the pre-commit hook fails the commit, but not if the commit is permitted. Therefore, they should add debugging code to the commit hook, so when it fails, it's easy to see where it fails, and if there's some reason for rejecting your transaction, it will give you the reason.
来源:https://stackoverflow.com/questions/12837754/svn-commit-blocked-by-pre-commit-hook-exit-code-3-with-output