I'm gonna try to be as forthcoming as I can about my problem.
I'm on a Windows computer. The SVN repository is on a Linux machine.
I access the Linux machine remotely, using Putty and logging in as root. Everything is done through the command line.
Now, I have to set up a pre-commit hook that won't allow special characters like [éáú] on source code files. In order to do that, I set out to find out how to setup a pre-commit hook.
Here's what I've done:
- Found a script
- Went to the hooks folder in the repository. Removed the extension of the file pre-commit.tmpl
- Pasted the script there and saved
- Ran the chmod command on file pre-commit.tmpl
Then I tried commiting a change to the repository and I got:
Commit blocked by pre-commit hook (exit code 255) with no output
Alright, I figured something was wrong in how I set up the pre-commit file, so I removed the script and added a simple echo "hello world".
Now the commit goes through, but the echo message doesn't show up at all. If I put exit 1 at the end of the script, I get error code 1 and the echo message still doesn't show up.
I have literally searched high and low on the internet and have found no solution to my problem.
What I need:
- An explanation as to why the echo messages are not showing up
- If possible, a step-by-step on how to set up and test a simple script
For example, I've seen a lot of scripts where there's something like this:
#!/bin/bash
REPOS="$1"
TXN="$2"
What am I supposed to put in REPOS and in TXN? I assume in REPOS I should put the repository path? What about TXN?
Any help is appreciated.
Cheers