Java Code Examples for org.eclipse.jgit.lib.PersonIdent#getWhen()

The following examples show how to use org.eclipse.jgit.lib.PersonIdent#getWhen() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GitSCM.java    From repositoryminer with Apache License 2.0 6 votes vote down vote up
private Commit processCommit(RevCommit revCommit) {
	PersonIdent author = revCommit.getAuthorIdent();
	PersonIdent committer = revCommit.getCommitterIdent();

	Developer myAuthor = new Developer(author.getName(), author.getEmailAddress());
	Developer myCommitter = new Developer(committer.getName(), committer.getEmailAddress());

	List<String> parents = new ArrayList<String>();
	for (RevCommit parent : revCommit.getParents()) {
		parents.add(parent.getName());
	}

	List<Change> changes = null;
	try {
		changes = getChangesForCommitedFiles(revCommit.getName());
	} catch (IOException e) {
		close();
		throw new RepositoryMinerException(e);
	}

	return new Commit(null, revCommit.getName(), myAuthor, myCommitter, revCommit.getFullMessage().trim(), changes,
			parents, author.getWhen(), committer.getWhen(), (parents.size() > 1), null);
}
 
Example 2
Source File: CommitGit.java    From coming with MIT License 5 votes vote down vote up
@Override
public String getRevDate() {
	PersonIdent authorIdent = revCommit.getAuthorIdent();
	Date authorDate = authorIdent.getWhen();
	SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
	return ft.format(authorDate);
}
 
Example 3
Source File: SubtreeMerger.java    From git-merge-repos with Apache License 2.0 5 votes vote down vote up
private PersonIdent getLatestPersonIdent(Collection<RevCommit> commits) {
	PersonIdent latest = null;
	for (RevCommit commit : commits) {
		PersonIdent ident = commit.getCommitterIdent();
		Date when = ident.getWhen();
		if (latest == null || when.after(latest.getWhen())) {
			latest = ident;
		}
	}
	return latest;
}