Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » how to retrieve number of changed lines per resource
how to retrieve number of changed lines per resource [message #1727406] Tue, 22 March 2016 19:32
Marc Lustig is currently offline Marc LustigFriend
Messages: 3
Registered: March 2016
Junior Member
hello, we need to find out the number of lines added/changed/removed per resource.

I'm using the following code to create a diff between two revisions/objectIds:

ObjectReader reader = git.getRepository().newObjectReader();
CanonicalTreeParser oldTreeIter = new CanonicalTreeParser();
oldTreeIter.reset(reader, first);
CanonicalTreeParser newTreeIter = new CanonicalTreeParser();
newTreeIter.reset(reader, second);
List<DiffEntry> diffs = git.diff().setOldTree(oldTreeIter).setNewTree(newTreeIter).call();

But the API for DiffEntry doesn't offer any methods for retrieving the number of changed/added/removed lines for the given resource.

Is there another approach that allows to retrieve that information?
Previous Topic:calling RevWalk for remote repository
Next Topic:No Git commands on Team menu
Goto Forum:

Current Time: Tue Feb 18 10:26:56 GMT 2020

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

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

Back to the top