git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Manuel Woelker" <manuel.woelker@gmail.com>
To: spearce@spearce.org, "Robin Rosenberg" <robin.rosenberg@dewire.com>
Cc: git@vger.kernel.org
Subject: [JGIT] Blame functionality for jgit
Date: Sun, 11 Jan 2009 21:23:16 +0100	[thread overview]
Message-ID: <3d045c7e0901111223j43a69402s28a59612212943f3@mail.gmail.com> (raw)

Hello there,

Over the weekend I have been hacking the jgit sources a little to see
if I can add blame/praise/annotate functionality to it. The results
can be found at http://github.com/manuel-woelker/egit/tree/blame . All
work is in the blame branch in org.spearce.jgit.blame package.

I largely ported the cgit blame algorithm described here
https://kerneltrap.org/mailarchive/git/2006/10/12/224187 , the
relevant file is builtin-blame.c cf.
http://repo.or.cz/w/git.git?a=blob;f=builtin-blame.c;hb=HEAD

The structure has been kept largely intact, but I have tried to
translate the concepts to idiomatic java, with the bulk of the logic
now in the Scoreboard class

The blame algorithm needs to use a diff algorithm to find common parts
in files. AFAICT there is no diff implementation in jgit at the
moment. I used the incava java-diff library, (see
http://www.incava.org/projects/java/java-diff ), but I introduced an
interface that should make it possible to swap implementations with a
minimum of effort. To compile I just create a new eclipse project with
the java-diff sources.

Currently renames, copies etc. are not supported, so only files with
the same name can receive the blame. Unmodified renames and copies
should be fairly simple to implement. Modified renames and copies
might prove to be a little bit harder, so that would have to wait
until jgit can follow history across renames/copies.

There are some simple unit tests to check the basic functionality. I
also "blamed" SUBMITTING_PATCHES in the egit repo, and got the same
results as cgit. I am certain that there a some bugs lurking in the
code, but overall it looks quite promising.

I would like to hear your thoughts on a couple of topics:
 - Merge/patch/diff/blame functionality needs a diff implementation,
what are our options within technical and license constraints?
 - What is the roadmap for these features?
 - Can you see this blame effort getting integrated upstream?

I would love to contribute more effort to egit and the blame
functionality in particular. To me, "blame" is one of the killer
features of modern SCMs.

Last no least, kudos to the git and egit teams for their hard work on
making git such a great piece of software.
 - Manuel Woelker

             reply	other threads:[~2009-01-11 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 20:23 Manuel Woelker [this message]
2009-01-12 17:42 ` [JGIT] Blame functionality for jgit Shawn O. Pearce
2009-01-12 21:17   ` Manuel Woelker
2009-01-12 21:55     ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d045c7e0901111223j43a69402s28a59612212943f3@mail.gmail.com \
    --to=manuel.woelker@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=robin.rosenberg@dewire.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).