On Jun 17, 2012, at 12:10, Nico Kadel-Garcia wrote: > On Jun 17, 2012, at 08:41, Chris Stäbler wrote: > >> a few days ago I set up a subversionserver. Now I wanted to check every >> commit for some conventions. I tried it with an pre-commit hook but always >> get the following error when I try to commit something: >> >> Some of selected resources were not committed. >> svn: E165001: Commit failed (details follow): >> >> svn: E165001: Commit failed (details follow): >> svn: E165001: Commit blocked by pre-commit hook (exit code 255) with >> no output. >> svn: E175002: MERGE of '/svn/firstrepo/repotest/trunk': 409 Conflict >> (http://...) >> >> Here is the content of my pre-commit script: >> >> #!/bin/sh >> REPOS=”$1” >> TXN=”$2” >> echo “something for the output” 1>&2 >> #cancel all commits for tests… >> exit 1 > > In Bash and in most programming languages, "exit 1" means failure. "exit 0" > means success and is probably what you should be using.
Nico, I think Chris knows that. He's trying to verify that a simple test pre-commit hook script prints the error message he wrote ("something for the output") and exits with the error code he specified (1). From the output he showed above, neither is happening; it prints no output, and it exits with code 255. He's asking why that's happening. Chris, I get the same result as you, if I forget to mark the pre-commit hook script as executable. So try "chmod 755 /path/to/repo/hooks/pre-commit", then try again. Also, not sure if it was a copy/paste error with your email program, but the script you showed above contains smart quotes (“”); for a bash script, you'll want to use straight quotes ("").