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.
We can also split the functionalities, but then the design becomes a bit
complexer, or we duplicate a lot of code.
Vincent