Git or Hg Repository exceeds number of allowed Committers
Problem
Adding a Git repository to Fisheye with a Starter license (10 users) installed will sometimes produce an error stating that there are more than 10 committers, even though there are less than 10 real people who have committed.
The following appears in the atlassian-fisheye-<date>.log
:
WARN [208:StdOutHandler <repository_name> ] fisheye DefaultLicenseEnforcer-validateCommitterLimit - Committer limit exceeded - committer list: user1 <user1@test.com>, user2 <user2@test.com>, ...
WARN [InitPing1 <repository_name> ] fisheye BaseRepositoryScanner-setLicensePolicyReached - License limit reached
com.cenqua.fisheye.LicensePolicyException: Exceeded number of allowed committers. Your licenses only allows 10 committers. This repository has 11
at com.cenqua.fisheye.rep.impl.DefaultLicenseEnforcer.validateCommitterLimit(DefaultLicenseEnforcer.java:74)
at com.cenqua.fisheye.rep.impl.CommonRevInfoDAO.insertNew(CommonRevInfoDAO.java:483)
You have exceeded the number of committers allowed by the Starter License. This is either a legitimate occurrence (you have more than 10 actual committers) or this problem can also affect Git and Mercurial Starter License users over time when their committers use different ids to commit to the repository.
Due to this change ( - FE-2496Getting issue details... STATUS ) in Fisheye 2.6, when we scan a Git repository, we now combine the author and email fields from the commit into a single field that Fisheye uses to determine who the committer is. This allows automatic email mapping to map the commit by that committer to a Fisheye User with the same email address.
If your committers use different email addresses for their commits, they will now count as more than one committer.
Diagnosis
Diagnostic Steps
The full list of committers identified by Fisheye is available in the log files as part of the following line. In the example below "user1 <user1@test.com" and "user2 <user1@test.com>" are the first two of the users identified, this list always contains at least 11 committers.
WARN [208:StdOutHandler <repository_name> ] fisheye DefaultLicenseEnforcer-validateCommitterLimit - Committer limit exceeded - committer list: user1 <user1@test.com>, user2 <user2@test.com>, ...
Resolution
For Mercurial, the only solution is to rewrite the history of your repository to map these committers to a single consistent committer id for each real committer you have (and to encourage them to be consistent in future).
This means getting all developers to delete their clones of the repository and re-clone once the history re-write is complete. Otherwise, they will probably end up pushing the old commits back into the repository being scanned by Fisheye and the problem will reoccur.
Warning
Be very sure you know what you are doing during this process: you are re-writing history and the wrong command could lose all of your repositories history and your source code. Keep a backup clone of your repository in case something goes wrong.
Rewriting history is also valid for Git (detailed below), but Git has an easier alternative, using the .mailmap file (see below for details).
Mercurial
In Mercurial, we use the Convert Extension to rewrite the committer names, using an authormap file. In the repository that Fisheye is scanning, you will need to use the Mercurial Queues Strip command to remove all the current commits once the converted repository is ready, otherwise you will simply add a new set of commits next to the originals.
Get a copy of the repository and use:
hg log --template "{author}\n" | sort | uniq
to list the current committer names.
- Identify those you want to rewrite and add an entry into a authormap file to rewrite them to another address.
Run:
hg convert my-clone rewritten-clone
- Strip the repository that Fisheye is indexing and push the
rewritten-clone
into it. Make sure all your developers use clones of the new copy of the repository from now on, otherwise they will possibly push back all the old commits and the problem will reoccur). - Go to the administration console in Fisheye for your repository and under the 'Maintenance' tab, select 'Re-clone and Re-index'.
Git
For a Git repository, you can change the committers by editing the .mailmap file. This allows the Git repository to report to Fisheye different names and email addresses than were actually used by the author - this will not affect any other repositories, unless they also get the .mailmap file in their local repositories. See the Mapping Authors paragraph on the Git shortlog page for more details.
Fisheye will use the version of the .mailmap
file that is checked in at HEAD
. This is normally the latest commit on master
(or your default branch, if you have set it to other than master
).
Note that if you want to map multiple email addresses to one author, you need to specify them on multiple lines.
E.g.
John Doe <john.doe@newcompany.com> <john@oldcompany.com>
John Doe <john.doe@newcompany.com> <johndoe@oldcompany.com>
John Doe <john.doe@newcompany.com> <jdoe@oldcompany.com>
- create or edit the .mailmap file on the master branch by consolidating the redundant names and email addresses into a limited number below or equal to 10
- run the
git shortlog -sne
to make sure that only the desired users are returned - commit and push the file to your repository
- log-in to Fisheye as an Administrator, select the affected repository from the Administration console and trigger the "Re-clone and Re-index" option from the "Maintenance" tab.