Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] How to get teh RevCommit objects for a list of changesers in one call?

Dear Jgit List,

I have a collection of changeset ids. I'd like to write a method to get the revcommit objects for all of the ids in one call (efficiently). Currently I'm using this code:

RevWalk changeLogWalk = new RevWalk(localRepository);
List<RevCommit> revCommits = new ArrayList<RevCommit>();
for (String ref: refs) {
AnyObjectId changesetId = localRepository.resolve(ref);
if (changesetId != null) {
RevCommit commit = changeLogWalk.parseCommit(changesetId);
revCommits.add(commit);
}
}
for (RevCommit commit: revCommits) {
changeLogWalk.markStart(commit);
result.add(changeLogWalk.next());
}
It turns out that this code performs very badly on large changeset id lists. Could you please give me some hints to make it much more efficient?

Thanks in advance,
Ákos Tajti


Back to the top