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 cad2790ac..53fc70d02 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()}) *
- * This is currently a very basic implementation which takes only one starting
- * revision as option.
+ * Examples (git
is a {@link Git} instance):
+ *
+ * Get newest 10 commits, starting from the current branch: + * + *
+ * ObjectId head = repository.resolve(Constants.HEAD); + * + * Iterable<RevCommit> commits = git.log().add(head).setMaxCount(10).call(); + *+ *
* - * TODO: add more options (revision ranges, sorting, ...) + *
+ * Get commits only for a specific file: + * + *
+ * git.log().add(head).addPath("dir/filename.txt").call(); + *+ *
* * @see Git documentation about Log