diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java index cad2790aca..53fc70d02d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java @@ -74,10 +74,24 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter; * to finally execute the command. Each instance of this class should only be * used for one invocation of the command (means: one call to {@link #call()}) * <p> - * This is currently a very basic implementation which takes only one starting - * revision as option. + * Examples (<code>git</code> is a {@link Git} instance): + * <p> + * Get newest 10 commits, starting from the current branch: + * + * <pre> + * ObjectId head = repository.resolve(Constants.HEAD); + * + * Iterable<RevCommit> commits = git.log().add(head).setMaxCount(10).call(); + * </pre> + * <p> * - * TODO: add more options (revision ranges, sorting, ...) + * <p> + * Get commits only for a specific file: + * + * <pre> + * git.log().add(head).addPath("dir/filename.txt").call(); + * </pre> + * <p> * * @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-log.html" * >Git documentation about Log</a> |