I called the jgit log command and got back some RevCommit objects. I can get back some basic information from it and I use the following code to get the list of files that changed. There are two more things that I need though:
1) how do I get the information below when the commit doesn't have a parent?
2) how do I get the diff of the content that changed in each file
RevCommit commit = null;
RevWalk rw = new RevWalk(repository);
RevCommit parent = null;
if (commit.getParent(0) != null) {
parent = rw.parseCommit(commit.getParent(0).getId());
}
DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE);
df.setRepository(repository);
df.setDiffComparator(RawTextComparator.DEFAULT);
df.setDetectRenames(true);
List<DiffEntry> diffs = df.scan(parent.getTree(), commit.getTree());
for (DiffEntry diff : diffs) {
System.out.println(getCommitMessage());
System.out.println("changeType=" + diff.getChangeType().name()
+ " newMode=" + diff.getNewMode().getBits()
+ " newPath=" + diff.getNewPath()
+ " id=" + getHash());
}