1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.git

File GitManager.java

 

Code metrics

0
0
0
1
68
15
0
-
-
0
-

Classes

Class Line # Actions
GitManager 38 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.git;
21   
22    import java.util.Date;
23    import java.util.List;
24    import java.util.Set;
25   
26    import org.eclipse.jgit.lib.PersonIdent;
27    import org.eclipse.jgit.lib.Repository;
28    import org.gitective.core.stat.UserCommitActivity;
29    import org.xwiki.component.annotation.Role;
30   
31    /**
32    * Provides services to access a Git repository.
33    *
34    * @version $Id: 6912a3943794147fec7c5395961d91dadb0b65c4 $
35    * @since 5.3M2
36    */
37    @Role
 
38    public interface GitManager
39    {
40    /**
41    * Clone a Git repository by storing it locally in the XWiki Permanent directory. If the repository is already
42    * cloned, no action is done.
43    *
44    * @param repositoryURI the URI to the Git repository to clone (eg "git://github.com/xwiki/xwiki-commons.git")
45    * @param localDirectoryName the name of the directory where the Git repository will be cloned (this directory is
46    * relative to the permanent directory
47    * @return the cloned Repository instance
48    */
49    Repository getRepository(String repositoryURI, String localDirectoryName);
50   
51    /**
52    * Find all authors who have ever committed code in the passed repositories.
53    *
54    * @param repositories the list of repositories in which to look for authors
55    * @return the list of authors who have ever contributed code in the passed repository
56    */
57    Set<PersonIdent> findAuthors(List<Repository> repositories);
58   
59    /**
60    * Count commits done by all authors in the passed repositories and since the passed date. Note that authors are
61    * uniquely identified by their email addresses.
62    *
63    * @param since the date from which to start counting. If null then counts from the beginning
64    * @param repositories the list of repositories in which to look for commits
65    * @return the author commit activity
66    */
67    UserCommitActivity[] countAuthorCommits(Date since, List<Repository> repositories);
68    }