From: Johannes Schindelin Date: Thu, 03 Sep 2009 00:04:17 GMT Subject: Re: [JGIT] Request for help Message-ID: In-Reply-To: <4A9EFFB1.9090501@codeaurora.org> Hi, On Wed, 2 Sep 2009, Nasser Grainawi wrote: > I'm looking to add 'git patch-id' to JGit and I could use a few > pointers. I'm not very familiar with the JGit code base or Java, so > please excuse any blatant oversights or unintelligent questions. > > First off, is there a "hacking JGit" document anywhere? One of those > would be great right now. There have been some mails with details about JGit from Shawn (IIRC) to this very list. > So far I'm just trying to define the inputs and outputs. On Shawn's > suggestion I'm planning on making it part of the org.spearce.jgit.patch > package. C Git patch-id very generically has an input of a 'patch', so > I'm thinking this implementation should use the Patch object. C Git patch-id takes a valid patch as input; I do not think that you want to use the Patch object. FWIW a patch-id is nothing else than the SHA-1 of a diff where the "diff", "index", "@@" lines and all the whitespace was removed. This is not really difficult in Java, however, it relies on a working diff implementation (and IIRC my implementation has not yet been integrated into JGit). Ciao, Dscho