Trac 1.2.5, git and explicit sync

18 views
Skip to first unread message

tw77

unread,
Apr 10, 2020, 1:50:16 PM4/10/20
to Trac Users
Hi,

I can't get rid of the per-request synchronization.

Here's the setup:
- Ubuntu Server 16.04.6
- Trac 1.2.5
- Git 2.7.4

I have a single Trac project with 2 svn repositories. I've defined post-commit hooks for them and everything works as expected (surce browsing, timeline, ticket referencing).

But now I'm trying to add a third repository, a git one.
I configured a post-receive hook:

#!/bin/sh
export PYTHON_EGG_CACHE="/tmp/python_egg_cache"
/usr/local/bin/trac-admin /path/to/my_trac_env changeset added "$1" "$2"

But it doesn't the job!

I can browse the source code, i can see commits in the timeline, but the commits aren't added to the tickets.

This behaviour (timeline has commits, tickets don't) is often connected with sync_per_request. But as far as I can see, I don't have it enabled.

The trac.ini doesn't have it on and in the "repository" table the "sync_per_request"-option ist set to false for the git repository.

The post-receive hook seems ok; if I call it directly (like mentioned here: https://groups.google.com/d/msg/trac-users/ELU632puVSg/cMIUr-44BQAJ ), the ticket get the expected comment.

What else can I do? Where can I control the sync-behaviour?


Thanks in advance,

Thomas




RjOllos

unread,
Apr 10, 2020, 8:18:13 PM4/10/20
to Trac Users
You may need to enable [git] cached_repository

We have an open ticket for making the behavior more consistent across repository backends:

There's also a robust post-receive hook here:

But if you call the hook directly and it works, it seems like the problem is that your Git hook is not being called when a commit is pushed.

- Ryan

tw77

unread,
Apr 11, 2020, 1:26:56 AM4/11/20
to Trac Users
Hi,

thanks for the fast response...

Enabling the "cached_repository" option does the trick.

I activated it and removed any hooks:
no updates in timeline and tickets on git push (as expected)

Then I reactivated my post-receive hook:
updates in timeline and tickets on git push *yeah*

Finally I gave the mentioned hook script a try and it works too.


Thanks again, Happy Easter and stay healthy,
Thomas
Reply all
Reply to author
Forward
0 new messages