1 package org
.spearce
.jgit
.pgm
;
4 import java
.io
.IOException
;
5 import org
.spearce
.jgit
.lib
.Commit
;
6 import org
.spearce
.jgit
.lib
.ObjectId
;
7 import org
.spearce
.jgit
.lib
.Repository
;
10 public static void main(String
[] args
) throws IOException
{
11 Repository db
= new Repository(new File(".git"));
12 Commit commit
= db
.mapCommit(args
[0]);
13 System
.out
.println("commit " + commit
.getCommitId());
14 System
.out
.println("tree " + commit
.getTreeId());
15 ObjectId
[] ps
=commit
.getParentIds();
16 for (int ci
=0; ci
<ps
.length
; ++ci
) {
17 System
.out
.println("parent " + ps
[ci
]);
19 System
.out
.println("author " + commit
.getAuthor());
21 System
.out
.println(commit
.getMessage());