tags:

views:

394

answers:

2

I'm looking to build and publish a latex document every time I advance the tip of a specific branch.

I'm looking at what hook I should be putting my build script and which conditions I need to check for.

+2  A: 

If changes are coming in via a push to a remote, then on the remote server you'll want to use the post-receive hook (though if you use pre-receive then you can reject the push if, say, latex fails).

If you're using your local repository you should use post-commit (or pre-commit if you want to be able to reject the commit).

The hooks are documented in the git hooks man page.

Pat Notz
In my post-commit, how to i find out which branch was committed to?
Flame
Oh also, will this trigger on a merge or fast-forward?
Flame
+1  A: 

Probably a little late... but you can find out which branch was committed to by using

if [ `git rev-parse --abbrev-ref HEAD` == "master" ]

in you script when you checked out the branch to commit in it.

msmart