I am using git with trac. After clicking, I want to do two things:
- Sending email to a developer using diff
- If there is a special phrase in the commit message (for example, “see No. 1”), I want the commit message to be placed on the trac ticket.
The first thing is solved with git-commit-notifier. It works fine after I created the post-receive hook:
#! / bin / sh
/var/lib/gems/1.8/bin/git-commit-notifier /etc/git-commit-notifier.yml
My second requirement can be resolved as described in http://trac-hacks.org/wiki/GitPlugin#post-receivehookscripts . It also works great with such a hook after taking it:
#! / bin / sh
/ var / trac / testgit / commit-updater
Both things work when they are separate. But I need to combine them. So, I created a post-receive hook:
#! / bin / sh
/ var / trac / testgit / commit-updater
/var/lib/gems/1.8/bin/git-commit-notifier /etc/git-commit-notifier.yml
It is very funny, but it does not work. Commands work fine when the launch is done separately, but only the first one works when they are put into the hook after receiving.
If I have such a hook:
#! / bin / sh
/ var / trac / testgit / commit-updater
/var/lib/gems/1.8/bin/git-commit-notifier /etc/git-commit-notifier.yml
I get the following error
/var/lib/gems/1.8/gems/git-commit-notifier-0.8.0/bin/git-commit-notifier:12: undefined method `strip 'for nil: NilClass (NoMethodError)
from /var/lib/gems/1.8/bin/git-commit-notifier:19:in `load '
from /var/lib/gems/1.8/bin/git-commit-notifier:19
But if I go to the order of these two teams, I get no errors, but only the first command works.
I would be grateful for any help. I have been trying to solve this problem for a long time and I have no ideas.
git shell hook git-post-receive trac
bessarabov
source share