libgit2 / libgit2/libgit2sharp

How to get lines modified in a commit

Open
#1,490 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

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...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Repository.Diff.Compare and the Patch data it returns, since the issue says the needed line information is absent there. Trace the diff API's existing documentation or examples to determine where changed line numbers are exposed. Done means identifying a supported way to retrieve the specific changed lines, or documenting that the API does not provide them.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.