Most efficient way to retrieve diffentries across all commits [message #1854975] |
Wed, 21 September 2022 04:24 |
Eclipse User |
|
|
|
Hey,
I am currently using JGit to walk through a repository, retrieve all commits, and extract the changed files for each commit plus some metadata.
Obviously most time is spent in org.eclipse.jgit.internal.storage.file.Pack.get () when running TreeWalk.enterSubtree and I do not expect this to speed up a lot.
My main question is, if there are possibilities to stop doing some duplicate work. Right now I retrieve two `RevCommit` instances and then run.
OutputStream outputStream = NullOutputStream.INSTANCE;
try( DiffFormatter formatter = new DiffFormatter(outputStream)) {
formatter.setRepository(git.getRepository());
diffs = formatter.scan(commit, latestCommit);
}
Would it be more efficient to reuse some data structures, as each commit is used in two comparisons?
Any help appreciated as I am quite the JGit newbie :-)
--Alex
|
|
|
Powered by
FUDForum. Page generated in 0.04898 seconds