Project

General

Profile

Actions

Patch #1796

closed

Map repository authors to Redmine login names

Added by Bernd Lommerzheim over 16 years ago. Updated about 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2008-08-17
Due date:
% Done:

0%

Estimated time:

Description

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.


Files

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

Related issues

Related to Redmine - Feature #1383: Map repository authors to Redmine usersClosedJean-Philippe Lang2008-06-05

Actions
Actions #1

Updated by Jean-Philippe Lang about 16 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.

Actions

Also available in: Atom PDF