Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The title must sound strange but I'm trying to achieve the following:

SVN repo location: /home/flx/svn/flxdev SVN repo "flxdev" structure:

 + Project1
 ++ files
 + Project2
 + Project3
 + Project4

I'm trying to set up a post-commit hook that automatically checks out on the other end when I do a commit.

The post-commit doc explicitly lists the following:

# The post-commit hook is invoked after a commit.  Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#   [1] REPOS-PATH   (the path to this repository)
#   [2] REV          (the number of the revision just committed)

So I made the following command to test:

echo "Updated project $REPOS to $REV"

However when I edit files in Project1 for example, this outputs "Updated project /home/flx/svn/flxdev to 1016"

I'd like this to be: "Updated project Project1 to 1016"

Having this variable allows me to specify to do different actions per project post-commit. How can I specify the project parameter?



share|improve this question
up vote 1 down vote accepted

Use svnlook.

Quick and dirty would be to try something like:

CHANGED_DIRS="`/usr/bin/svnlook -r $REV dirs-changed $REPOS`"

echo "Updated paths $CHANGED_DIRS in revision $REV"

You may want to try running svnlook help; it will list out the various commands you can use/information you can get.

share|improve this answer
Awesome, that's exactly what I need! Thanks! – FLX Dec 22 '10 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.