From f68ffb48eb16171da3d42b91f20c842201ea7431 Mon Sep 17 00:00:00 2001 From: Robin Stocker Date: Fri, 16 Aug 2013 15:38:43 +0200 Subject: [PATCH] LogCommand: Remove outdated TODO and improve docs Change-Id: I368be12e7bdc3c711e9f474ead312006513764b7 Signed-off-by: Robin Stocker --- .../src/org/eclipse/jgit/api/LogCommand.java | 20 ++++++++++++++++--- 1 file 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 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