Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] API to know the additions and removals

Thanks
On 6/27/2016 6:18 PM, Matthias Sohn wrote:
On Mon, Jun 27, 2016 at 7:31 PM, Pascal Rapicault <pascal@xxxxxxxxxxxx> wrote:
Hi,

In Egit or JGit, is there an API that would help in knowing the number of lines added or removed between a file contained in the last commit and the same file in the Eclipse workspace.

Use HistogramDiff.diff() to compute an EditList. Sum up Edit.getLengthA() to get number of deletions
sum up Edit.getLengthB() to get number of insertions.

For a complete example see Gerrit's PatchListLoader [1] and PatchListEntry [2]



Back to the top