Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.log()


    public static void main(String[] args) throws IOException, InvalidRefNameException, GitAPIException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        Git git = new Git(repository);
        Iterable<RevCommit> commits = git.log().all().call();
        int count = 0;
        for (RevCommit commit : commits) {
            System.out.println("LogCommit: " + commit);
            count++;
        }
View Full Code Here


  private Collection<GitVersionInfo> history(File file, LogCommandSpec logCommandSpec) throws GitAPIException{
    Repository repository = getRepository(file);
    Git git = new Git(repository);
    String fileSystemPath = getPath(file, repository);

    Iterable<RevCommit> log = logCommandSpec.specify(git.log(), repository).call();
    List<GitVersionInfo> versions = new ArrayList<GitVersionInfo>(historyDepth);
    for (RevCommit revCommit : log) {
      versions.add(makeVersionInfo(revCommit));
    }
    return versions;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.