Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a git post-commit hook for trac repository integration

Tags:

git

trac

I'm using trac v1 (which includes the Git plugin) on linux to trac multiple git repositories within the same trac installation. When I add a new repository to this trac installation it tells me:

"You should also set up a post-commit hook on the repository to call trac-admin $ENV changeset added "kontrolla-sample" $REV for each committed changeset."

Can someone show an example of how the post-commit file should be edited to achieve this?

like image 372
geoidesic Avatar asked Sep 16 '26 00:09

geoidesic


1 Answers

See http://trac.edgewall.org/wiki/TracRepositoryAdmin#ExplicitSync for examples and details about what is needed from a post-commit hook script (or more accurately, post-receive for git). Essentially, the script needs to call trac-admin /your/trac/path/here changeset added "(default)" <revision>. If the commit is to a repository other than the default repo, change (default) to the name of the repository.

like image 95
bta Avatar answered Sep 18 '26 15:09

bta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!