Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Add git_blame_buffer #1979

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

9at8
Copy link

@9at8 9at8 commented Jul 30, 2022

Motivation and Background

I was trying to make a VS extension that implements something like GitLens on VSCode. If you don't know what that is that's ok. It has a lot of features, but the main thing that I use it for is to view per line blame along with the commit message like so:

image

I am using libgit2sharp to develop my extension. Currently I'm using repo.Blame(filePath) to get grab the BlameHunkCollection and display the message on a line using the VS extensibility api. repo.Blame uses git_blame_file under the hood and git_blame_file has a couple of issues for my usecase:

  • It is really slow
  • I can get an accurate blame result only after saving the file to disk. In other words, I cannot get the blame results for a file that is still being worked on/is open in memory

Purpose of this PR

I am creating this PR to start a discussion for adding something similar to git_blame_buffer to libgit2sharp. There might be a better way to implement this functionality, and I would to get some feedback and bounce ideas to add this feature to the library in the best way possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant