git blame equivalent #67

Closed
jonashaag opened this Issue Jul 1, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@jonashaag
Owner

jonashaag commented Jul 1, 2013

No description provided.

@posativ

This comment has been minimized.

Show comment Hide comment
@posativ

posativ Jan 17, 2014

Contributor

Hi,

I made a quick draft for a git-blame equivalent: https://github.com/posativ/klaus/tree/feature/git-blame

bildschirmfoto 2014-01-17 um 17 26 42

Live

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.

Contributor

posativ commented Jan 17, 2014

Hi,

I made a quick draft for a git-blame equivalent: https://github.com/posativ/klaus/tree/feature/git-blame

bildschirmfoto 2014-01-17 um 17 26 42

Live

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.

@jonashaag

This comment has been minimized.

Show comment Hide comment
@jonashaag

jonashaag Jan 17, 2014

Owner

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.

Owner

jonashaag commented Jan 17, 2014

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.

@posativ

This comment has been minimized.

Show comment Hide comment
@posativ

posativ Feb 10, 2014

Contributor

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

Contributor

posativ commented Feb 10, 2014

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

@jelmer

This comment has been minimized.

Show comment Hide comment
@jelmer

jelmer Jan 17, 2015

Contributor

FWIW jelmer/dulwich#245 tracks blame support in dulwich.

Contributor

jelmer commented Jan 17, 2015

FWIW jelmer/dulwich#245 tracks blame support in dulwich.

@jonashaag

This comment has been minimized.

Show comment Hide comment
@jonashaag

jonashaag Jan 18, 2015

Owner

Thanks, subscribed.

Owner

jonashaag commented Jan 18, 2015

Thanks, subscribed.

@jonashaag

This comment has been minimized.

Show comment Hide comment
@jonashaag

jonashaag Jul 27, 2015

Owner

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

Owner

jonashaag commented Jul 27, 2015

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