Patch #1796

Map repository authors to Redmine login names

Added by Bernd Lommerzheim about 14 years ago. Updated almost 14 years ago.

Status:ClosedStart date:2008-08-17
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


This patch maps the repository authors to the Redmine user database and displays the users name in the format which is set in the Redmine settings. As this patch just adds a new method (self.author_to_name) to the user model and just slightly modifies some views, it can be safely applied for testing and reverted when it is not needed anymore. It can be a solution of the feature request #1383. I just tested it with Subversion, but it should work with every SCM in which the author is in the same format as the login names of the Redmine users.

Unfortunately the patch is not very effectively, because everytime an author is used in a view, it is checked against the Redmine user table. And because of this while blaming a big file, a lot of database querys are performed (one for each line). I tried to use a hash lookup variable, which stores the pair (author, name) in order to query each author only once per page request. But a longer use of the lookup variable is not possible, because the lookup table could store an old value when the user's name or the Redmine name format setting is changed. I used a class variable (@variable) which is stored over the whole Redmine uptime and hence it is not useable. Can somebody explain me, how to create and use a class variable which is just active while one page request? Then I will improve the patch and upload it here.

This is the first time I wrote Ruby (and Ruby on Rails) code. I hope the patch has a good code quality and please give me feedback in order to improve the patch. Maybe I forgot to modify some views to use the new function. Please report this. Then I can add this view to the patch. Thanks a lot. And Jean-Philippe, thanks for this incredible piece of software.

redmine-map-author-to-name-r1747.patch Magnifier - map repository authors to redmine login names against r1747 (5.5 KB) Bernd Lommerzheim, 2008-08-17 21:52

Related issues

Related to Redmine - Feature #1383: Map repository authors to Redmine users Closed 2008-06-05


#1 Updated by Jean-Philippe Lang almost 14 years ago

  • Status changed from New to Closed

Feature added in r2006 (see #1383).
Mapping is stored in the database so that it can be manually adjusted (eg. when repository usernames don't match Redmine usernames) and to avoid searching the database each time the author is displayed.

Also available in: Atom PDF