My question is as stated in the title - I want to get the specific line numbers that were changed in a commit. I've been looking at Repository.Diff.Compare<Patch> but the info I need isn't there...
Hi @tylercamp.
@ale7canna and I are trying to get the same information. So far, the only option I see is to parse the string Patch property of PatchEntryChanges. Chances are in the meanwhile you found a more convenient way...
Also, this seems a duplicate of #1142
@arialdomartini Sadly we didn't find a solution, and efforts were directed elsewhere.
@tylercamp, @ale7canna and I are working on one, and will propose a PR soon.
So far, I'm relying on the regex
@"@@\s\-(?<oldFrom>\d+),(?<oldLength>\d+)\s\+(?<newFrom>\d+),(?<newLength>\d+).*\s@@";
which can extract the information you are looking for from the patch itself. In our PR we aim to provide libgit2sharp with a more convenient, native C# API.
Most helpful comment
@tylercamp, @ale7canna and I are working on one, and will propose a PR soon.
So far, I'm relying on the regex
which can extract the information you are looking for from the patch itself. In our PR we aim to provide libgit2sharp with a more convenient, native C# API.