Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Most efficient way to retrieve diffentries across all commits
Most efficient way to retrieve diffentries across all commits [message #1854975] Wed, 21 September 2022 04:24
Eclipse UserFriend
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
Previous Topic:Working Tree must not be numerical sorted
Next Topic:Mismatch between git clone and JGit's cloneRepository
Goto Forum:
  


Current Time: Fri May 23 05:46:40 EDT 2025

Powered by FUDForum. Page generated in 0.04898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top