JGit JavaDoc and get log only certain range [message #654550] |
Wed, 16 February 2011 04:38  |
Eclipse User |
|
|
|
Hi all,
I'm making integrate git scm with my Java application. I decided use a JGit library for this, but I didn't find a JavaDoc for JGit. Where can I find the JavaDoc?
and other questions. How can I make query log in within a certain range. as look like this.
git log --since="Tue Feb 15 13:05:13 2011 +0300"
At the moment I know how get all log from git, but I need get log only certain range.
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.LogCommand;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryBuilder;
import org.eclipse.jgit.revwalk.RevCommit;
import java.io.File;
public class JGitTest {
public static void main(String[] arg) throws Exception {
RepositoryBuilder builder = new RepositoryBuilder();
File repos = new File("/home/pitbull/projects/GitPr");
Repository repository = builder.findGitDir(repos).build();
Git git = new Git(repository);
LogCommand log = git.log();
for (RevCommit commit : log.call()) {
System.out.println(commit.getAuthorIdent().getName());
System.out.println(commit.getAuthorIdent().getWhen());
System.out.println(commit.getFullMessage());
}
}
}
Please I need help.
Thanks.
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05427 seconds