I want to ran the following script on text files that are being committed:
# Send the commands H and w to ed
# ed will append newline if the file does not end in one
printf "%s\n" H w | ed -s $1
# Strip trailing whitespace
sed -i 's/[ \t]*$//g' $1
# Convert tabs to 4 spaces
sed -i -r "s/\t/ /g" $1
I see subversion has a start-commit and pre-commit hooks but I can't follow the documentation about how I could process the text files with the above script.