Skip to content


Subversion checkout URL

You can clone with
Download ZIP


git blame equivalent #67

jonashaag opened this Issue · 6 comments

3 participants


No description provided.



I made a quick draft for a git-blame equivalent:

bildschirmfoto 2014-01-17 um 17 26 42


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?

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.


Thanks, subscribed.


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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.