Hi Peter,

Quoting Peter Suter <[email protected]>:
On 13.08.2014 17:17, W. Martin Borgert wrote:
I'm using Trac with Git and the nice CommitTicketUpdater.

Problem: When a ticket is closed via a commit message in a branch,
later the ticket is re-opened, and then the branch gets merged and
pushed, the ticket gets closed again.

In theory, a commit message, that has been seen and interpreted by
Trac should not be interpreted again, when only a merge is done,
right?

Or better(?), closes/fixes should be interpreted as refs only.

Any solution for this?

What hook script are you using to call "trac-admin changeset added"?

A very simple (simplistic?) one:

#!/bin/sh

REPO=$(basename $(dirname $(cd $(dirname $0); pwd)) .git)
TRACENV=environment_A
for rep in repository_abc repository_xyz; do
    [ $rep = $REPO ] && TRACENV=environment_B
done

while read oldrev newrev refname; do
    git rev-list --reverse $newrev ^$oldrev \
    | while read rev; do
        trac-admin /var/lib/trac/$TRACENV changeset added $REPO $rev
    done
done

I think the solution is not to send such changesets to Trac more than once.
Maybe try the one proposed here:
http://trac.edgewall.org/ticket/10730#comment:8

Many thanks, I'll look into it.

In older commit (< Trac 1.0, IIRC) scripts, there was also a database
table, that collected commit ids, that where already processed. That way
it was easy to ignore (or special-handle) dupes. Maybe I'll try such an
approach. If I succeed, I'll post the results.

Cheers

--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to