On 03/24/2014 05:50 PM, Vincent van Ravesteijn wrote:
Op 24 mrt. 2014 22:44 schreef "Richard Heck" <[email protected]
<mailto:[email protected]>>:
>
> On 03/24/2014 05:28 PM, Vincent van Ravesteijn wrote:
>>
>> Richard Heck schreef op 24-3-2014 22:23:
>>>
>>> On 03/24/2014 04:39 PM, Vincent van Ravesteijn wrote:
>>>>
>>>> Even when using feature/staging-branches in the development, one
might want to link bug tickets to the commits that fix the bug in
master. When the fix is in the features repo, or in the staging area,
it is very likely that the commit id of the bug fix changes before it
enters master.
>>>>
>>>> To still have the correct link in the bug ticket, we had the idea
to automatically add a link from the bug ticket in trac to a certain
commit if the commit has the text "Fixes: #8320" or some variant given
that it matches to a certain regex. To accomodate this, I have written
a git hook that adds a comment to the bug in trac when such a line in
detected: "Fixed in master at [deadbeef/lyxgit]". The exact regex is
customizable, also we can think about adding keywords automatically,
doing the same for branch, and to notify the committer by e-mail.
>>>>
>>>> Attached is the first version of the script.
>>>>
>>>> Can I proceed adding this to the git hook on the server ?
>>>>
>>>> Anyone willing to review the python code, and to follow the steps
I have to take in the server configuration ?
>>>
>>>
>>> Are you planning to add this to the existing post-receive script?
Or chain them together? Or....?
>>>
>>> Richard
>>>
>>
>> 90 percent of the functions I just copied from the existing script.
So, it is actually not much new code. Instead of passing a Mailer
object through the function chain, we also pass a TracUpdater object,
and in the end we send an email and update trac.
>
>
> Sorry, maybe I'm confused, but, at least in the code you posted, I
don't see any Mailer object being passed, and I don't see where any
email gets sent. That script only updates trac. Did you attach the
wrong script?
>
> Richard
>
This script indeed only updates Trac. It is however very similar to
the existing script that does the mailing.
Merging them is easy, but we might want to have two separate scripts
and factor out the common code.
It will probably run faster if we merge them. It's not a lot of code,
but my sense is that these hooks run kind of slowly.
Richard