Opened 10 years ago
Closed 10 years ago
#11864 closed defect (fixed)
[git] trac_user_rlookup is ineffective with cached repository
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.3 |
Component: | plugin/git | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Improved documentation for |
||
API Changes: | |||
Internal Changes: |
Description
The [git] trac_user_rlookup
has not effect when [git] cached_repository
is true
.
Attachments (0)
Change History (7)
comment:1 by , 10 years ago
follow-up: 3 comment:2 by , 10 years ago
After disabling [git] trac_user_rlookup
and syncing the commit, its git author is stored in revision.author
with no changes.
Trac [/dev/shm/tmp/t11864]> config get git trac_user_rlookup disabled Trac [/dev/shm/tmp/t11864]> repository sync '' e370d900fa0a0b9c67b23e1ea0b53b7c28bdb376 e370d900fa0a0b9c67b23e1ea0b53b7c28bdb376 resynced on (default). Trac [/dev/shm/tmp/t11864]> $ sqlite3 /dev/shm/tmp/t11864/db/trac.db SQLite version 3.7.9 2011-11-01 00:52:41 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .mode line sqlite> select * from revision where rev='e370d900fa0a0b9c67b23e1ea0b53b7c28bdb376'; repos = 1 rev = e370d900fa0a0b9c67b23e1ea0b53b7c28bdb376 time = 1417633159000000 author = jomae <jun66j5@gmail.com> message = [#11503] 1.0.3dev: fixed raising `UnicodeDecodeError` when url has no handler and unicode characters with trailing slash
follow-up: 4 comment:3 by , 10 years ago
Replying to jomae:
After disabling
[git] trac_user_rlookup
and syncing the commit, its git author is stored inrevision.author
with no changes.
You are right, it works. I was expecting the lookup to occur dynamically regardless of whether the changeset is cached or not. Just changing trac_user_rlookup
from false
→ true
is not enough, the repository must be resynced.
Since the replaced username is saved in the Revision
table, the option documentation that states costly if you have many users seem slightly misleading because while it might slow down the sync, it shouldn't slow down any of the views, right? I'm assuming costly implies that requests might be slower.
comment:4 by , 10 years ago
You are right, it works. I was expecting the lookup to occur dynamically regardless of whether the changeset is cached or not. Just changing
trac_user_rlookup
fromfalse
→true
is not enough, the repository must be resynced.
Okay. I understand this issue.
Since the replaced username is saved in the
Revision
table, the option documentation that states costly if you have many users seem slightly misleading because while it might slow down the sync, it shouldn't slow down any of the views, right? I'm assuming costly implies that requests might be slower.
Enabling the option on cached repository would lead slowness of sync. Because usernames and emails are retrieved from sessions using Environment.get_known_users()
.
If the option is disabled and cached_repository
is enabled, I suppose that requests wouldn't be slow because GitCachedChangeset.author
property just returns revision.author
column with no changes. But if cached_repository
is disabled, requests would be very slow because GitChangeset.author
property calls git cat-file
and Environment.get_known_user()
every time.
comment:6 by , 10 years ago
Milestone: | next-dev-1.1.x → 1.0.3 |
---|---|
Owner: | set to |
Status: | new → assigned |
Proposed patch:
-
tracopt/versioncontrol/git/git_fs.py
diff --git a/tracopt/versioncontrol/git/git_fs.py b/tracopt/versioncontrol/git/g index 9a28f63..9924587 100644
a b class GitConnector(Component): 282 282 """) 283 283 284 284 trac_user_rlookup = BoolOption('git', 'trac_user_rlookup', 'false', 285 """Enable reverse mapping of git email addresses to trac user ids 286 (costly if you have many users).""") 285 """Enable reverse mapping of git email addresses to trac user ids. 286 Performance will be reduced if there are many users and the 287 `cached_repository` option is `disabled`. 288 289 A repository resync is required after changing the value of this 290 option. 291 """) 287 292 288 293 use_committer_id = BoolOption('git', 'use_committer_id', 'true', 289 294 """Use git-committer id instead of git-author id for the
comment:7 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Works for me….