Why does trac-post-commit hook only work on master branch?
|Reported by:||trac@…||Owned by:||hvr|
I confess that as a very new Trac user (using the git backend), I'm quite confused about what trac-admin changeset added does and why it is needed or important, but I did notice that until I got repository_sync_per_request set properly, attempting to browse the head of a recently-pushed branch produced a nasty error message instead of displaying the diff. (The confusion is why it can't look up cache misses in raw git before displaying an error message; unlike svn, a git commit is immutable.)
Now, although repository_sync_per_request doesn't seem like a major performance bottleneck ATM, I was heeding the advice at GitPlugin and t:wiki:TracRepositoryAdmin and looking into using a post-receive hook to avoid a ~0.1s delay on each HTTP request, but I noticed that it filters out changesets not on the master branch.
The reason for this restriction is very unclear. I'd think this would cause my original problem to reappear. (I haven't explicitly tested it, but if I update only non-master branches, it won't do any explicit synchronization, and if I have auto-sync turned off, that puts me back to where I started.) Does it date from before multiple branch support (#789) was added?
I can imagine removing it might cause a bad interaction with the t:wiki:CommitTicketUpdater. I certainly don't mind ticket closing being limited to updates to a few named branches. (I.e. "fixes #12345" should close the bug when it's merged to master, rather than when it's pushed to the testing branch.)
That would seem to be a problem with all backends that support branches (including SVN), but git users tend to use branches far more aggressively, pushing a proposed fix to a branch in the repository for discussion rather than attaching a patch to a ticket.