No description provided.
I made a quick draft for a git-blame equivalent: https://github.com/posativ/klaus/tree/feature/git-blame
Unfortunately, dulwich has no implementation for git-blame and for rapid prototyping, I used git blame -ls <rev> -- <path>. I took a quick look at builtin/blame.c and it seems to me like a non-trivial task to get a list of commits making the current file. Do you have any ideas how this can be implemented in Klaus using dulwich?
git blame -ls <rev> -- <path>
The template and view code needs some refactorization, of course. I decided to just replace the line numbers with the commit hashes (and links) unlike GitHub's blame which is rather unclear to me.
Cool, thanks! I like how it doesn't require much code (apart from templates). But yeah, yet another Dulwich limitation.
Maybe we should switch to libgit2. I never wanted to do that because you need to compile stuff in order to use it. But they say its written with platform independence in mind. EDIT: Seems like you need to install libgit2 before you can use pygit2. More me, that's enough of a reason to not depend on it. Maybe we could add a package that contains libgit2 though.
That's a really difficult decision. I like the part that Klaus is independent from any library not available on PyPi. But yeah, the limitations in Dulwich are becoming a bigger issue. Using the command-line is a possible workaround, but I'd rather see those calls in dulwich itself (I remember the slow log functionality).
FWIW jelmer/dulwich#245 tracks blame support in dulwich.
I'm fine with the implementation above for now (no real plans for switching to libgit2), so if anyone's interested in resurrecting that patch, you're welcome to work on it :-)