Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Search all versions of a file with jgit log takes long
Search all versions of a file with jgit log takes long [message #1852251] Fri, 06 May 2022 07:42 Go to next message
M Mt is currently offline M MtFriend
Messages: 1
Registered: May 2022
Junior Member
Hi.
When I search all versions of a specific file with jGit takes a long time, more that 6 minutes.
My repo has about 40k commits.
However, if I run
 git log --path
in command line, the result is instantaneos.

Here is the code we use:

        Git repo = Git.open(new File(repoPath));
        Iterable<RevCommit> commits = repo.log().addPath(fileName).call();
        Iterator<RevCommit> commit_it = commits.iterator();    
        while(commit_it.hasNext()){
            RevCommit commit = commit_it.next();

            ...

        } 


Any idea how to improve the performance using jGit?

Thanks
Re: Search all versions of a file with jgit log takes long [message #1852420 is a reply to message #1852251] Sun, 15 May 2022 21:52 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1212
Registered: July 2009
Senior Member
Have a look how
https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java
uses PathFilters to filter the git log for a path
Previous Topic:Adding JGIT to AEM results in dependency resolving issue
Next Topic:Egit showing all .class file in unstaged changes after building workspace
Goto Forum:
  


Current Time: Mon Sep 26 04:26:47 GMT 2022

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

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

Back to the top