Allow to do a mapping from commit log emails to real users

Issue #422 new
Christophe Combelles created an issue

The emails found in VCS commit logs are often crap because users don't update their hgrc correctly. So we can find emails such as user@msi or myself@laptop. It would be nice to be able to scan repositories for all these crap addresses, and store the mapping between these adresses and real users in the rhodecode. This is particularly important for code review because otherwise comments on changesets are never sent to the good place. I've created a clone to implement this behaviour. I've added a table to store the mapping, and a view to scan the repos and edit the mapping, that can be reached from the admin/users page (see the screenshot). I've also added a first migration step to 006.

Comments (5)

  1. Christophe Combelles reporter

    Hi, the clone is here I've mainly done that because I needed it for my own use, but it may be interesting for others.

    I'm not doing a pull request yet because I need help on the javascript part : The autocomplete does not work well on the log_mail_map I added. It doesn't work on the first focus, you have to type a letter, unfocus, refocus, then the autocomplete will work. It is not normally possible to reuse the same YUI Autocomplete on several fields, but I did it by changing the id of the input and container on focus and unfocus, then relaunching the MemberAutoComplete.

    And I'm not sure, should I rebase this work onto the 'beta' branch or not ?

  2. Marcin Kuzminski repo owner

    Looks great ! yes please it's very important that you work on beta branch.

    - it would be cool if one can specify the revision range for scann the logs if you have a repo with 100K commits, and just recantly one of the devs mismatched the emails, then you need to do a huge scan to extract this

  3. Christophe Combelles reporter

    Hi, I renamed the clone I've modified the scan to be incremental, based on a per-repository scan date, so a full scan is not required every time.

    And everything is in the beta branch now. (I'm also keeping the changes in the default branch, but this is just intended to be applied on my version in production.).

    I still have the mentionned javascript problem to fix. Will you have time to try all this? I'm sorry I didn't take time to write a functional test, but it would take more time to understand how to run a test in rhodecode involving repositories, emails, comments, etc.

  4. Marcin Kuzminski repo owner
    • removed version

    I also now did this option on user edit when you can add additional email addresses to user(in code-review branch) I'll think now how to merge those two.

  5. Log in to comment