Ticket #8737 (closed enhancement: worksforme)

Opened 2 years ago

Last modified 7 months ago

Support git in the hook script

Reported by: dmarti Assigned to: bobbysmith007
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

The hook interface for Git is different from Subversion -- in order to make this plugin work with git, I had to make a few changes to the hook script. Attached.

Attachments

trac-post-receive (13.7 kB) - added by dmarti on 04/27/11 00:46:04.
"post-receive" hook to use Trac from git

Change History

04/27/11 00:46:04 changed by dmarti

  • attachment trac-post-receive added.

"post-receive" hook to use Trac from git

04/27/11 20:55:05 changed by bobbysmith007

  • status changed from new to closed.
  • resolution set to worksforme.

the trac_post_commit.py is not inteded to be used as either an svn or git hook directly (at least as we use it). Thats is not to say that what you have done is incorrect or not going to work, just that it wasn't the way it was envisioned or the way we use it in our env.

If you look in the scripts dir, you will see that there are three possible "hook" scripts to accompany this one.

  • svn-post-commit.sh a standard svn post commit hook that calls the trac_post_commit.py
  • git-post-receive a simple git post receive hook that forwards commits on to trac_post_commit.py
  • git_post_receive.py - a much more complex git post receive that ensures each commit is only posted to trac once (rather than once per branch or only for a single branch).

I will note that none of these scripts performs the username munging that the one you posted does.

As such I dont think that this script needs to be merged in / committed. Do you agree? I updated the main wiki page to make some of this more obvious.

Thanks for your feedback, please let me know if you think there is any further action I need to take in regards to the post commit hooks

04/27/11 21:30:49 changed by dmarti

Thanks for the info.

On the server where this is going to be used, we have to be able to parse hours from commit messages (that will come in from git users) as well as hours added in the trac web interface, and make sure that they go to the same user -- so in the reports, hours for git user "joe@example.com" get added to the hours for Trac user "joe". Is there a way to do this with the existing scripts?

04/28/11 14:37:59 changed by bobbysmith007

No, that is definitely not something the scripts currently do. We have a relatively small number of employees with very direct mappings from git user to trac user (just drop the @whatever) so this has not been a need of ours.


Add/Change #8737 (Support git in the hook script)




Change Properties
Action