Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

#11764 closed defect (cantfix)

git integration repeats changeset_added multiple times for same commit

Reported by: matthauck@… Owned by:
Priority: normal Milestone:
Component: plugin/git Version: 1.0.1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The git plugin appears to repeat the changeset_added event multiple times for the same commit, even multiple days after it was made. This is rather annoying, in particular connection to the CommitTicketUpdater tracopt plugin which is now duplicating the commit reference message on that ticket each time it decides this commit was a new commit. So a commit I made 5 days ago is still making comments today (up to about 20 or so now) all with the same git commit message.

I captured the DEBUG log output of one of such events from trac.log:

2014-09-19 01:28:43,406 Trac[api] DEBUG: Event changeset_added on server for changesets (u'47928b',)
2014-09-19 01:28:43,411 Trac[git_fs] INFO: detected GIT version 2.1.0
2014-09-19 01:28:43,435 Trac[svn_fs] DEBUG: Subversion bindings imported
2014-09-19 01:28:43,436 Trac[PyGIT] DEBUG: PyGIT.Storage instance 60832976 constructed
2014-09-19 01:28:43,436 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage instance 60832976 for '/mnt/vcs/git/repositories/eng-server/server.git'
2014-09-19 01:28:43,436 Trac[git_fs] DEBUG: disabled CachedRepository for '/mnt/vcs/git/repositories/eng-server/server.git'
2014-09-19 01:28:43,609 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for 60832976
2014-09-19 01:28:44,514 Trac[PyGIT] DEBUG: rebuilt commit tree db for 60832976 with 16236 entries (took 905.3 ms)
2014-09-19 01:28:44,532 Trac[api] DEBUG: Event changeset_added on server for revision 47928b
2014-09-19 01:28:44,537 Trac[commit_updater] DEBUG: Updating ticket #27823
...

Attachments (0)

Change History (4)

in reply to:  description comment:1 by Jun Omae, 10 years ago

Component: version controlplugin/git
Milestone: undecided

Would you please post your git hook scripts? That seems your hook script has something wrong. IMO, I recomment to use trac-post-receive-hook-0.12-new-commits-from-all-branches.py​ in th:GitPlugin#post-receivehookscripts with post-receive hook.

2014-09-19 01:28:43,406 Trac[api] DEBUG: Event changeset_added on server for changesets (u'47928b',)

Also, the commit id is too short and strange. Length of git revision is 40 characters.

comment:2 by Matt Hauck <matthauck@…>, 10 years ago

We are using https://github.com/georgethomasuk/gitlab-trac-integration. This gets is setup as a cgi script and gets run via curl so that trac-admin gets invoked as www-data rather than actual git/svn user, so that we can limit access to the trac database to just www-data.

About the short commit hash: I had modified the gitlab-trac-integration plugin to use a shortened revision, which I thought would be okay by specifying shortrev_len = 7 in trac.ini. Thought this made the auto-commit message prettier to look at. I'll take that out to see if it fixes it. (Also, looking at it now, I realize now that my modified gitlab-trac-integration is only specifying length of 6 for the git revision… )

comment:3 by Jun Omae, 10 years ago

The integration should call changeset added command only once for the same commit. CommitTicketUpdater currently cannot determine whether the commit is first added. If the command is called twice for the same commit, the ticket would be updated twice.

comment:4 by Jun Omae, 10 years ago

Milestone: undecided
Resolution: cantfix
Status: newclosed

That is a issue of the integration, not a Trac issue.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.