How to get partial git history
We uses the following way to get git history:
GitHistoryUtils.history(project, repository.getRoot(), this.branchName);
It works pretty well for relatively new repo. However, for older ones with tons of commits, it take a really long time to get back the complete information.
As a matter of fact, we don't really need to get the full history of the repo. Is there an API that can get back the partial git history, like the latest 1000 commits?
Please sign in to leave a comment.
This method allows you to pass parameters to git via `String... parameters`.
For example, you can add ` --max-count=1000` to limit history depth.
Btw, what do you use this history for? There are could be a better/faster way (ex: by reusing cached data from VCS Log).
Great. That helps.
What we need is just the list of latest commits on the current repo/branch.