I have searching on the net for a while now trying to find a step in the right direction, but I am having no luck!
I am in the process of creating a program that is searching for possible defects within a software system. To do this we search the log files to find certain pointers to revision that contain 'bug fixes' (i.e. the commit message has a bug id number). When we find a possible 'big fix' we need to extract the code from the repository that could have been fixed. To do this we diff that revision to the one previously before it.
I know in cmd the code is git diff rev rev^. However I can not seem to replicate this in JGit. Does anyone know how this is achieved, or can point me in the right direction? I do have the code below so far is this right?
DiffCommand diff = git.diff();
ByteArrayOutputStream out = new ByteArrayOutputStream();
DiffFormatter df = new DiffFormatter(out);
FileTreeIterator oldTree = new FileTreeIterator(repo);
FileTreeIterator newTree = new FileTreeIterator(repo);