|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jgit.api.GitCommand<Iterable<RevCommit>>
org.eclipse.jgit.api.LogCommand
public class LogCommand
A class used to execute a Log command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to call())
This is currently a very basic implementation which takes only one starting revision as option. TODO: add more options (revision ranges, sorting, ...)
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jgit.api.GitCommand |
|---|
repo |
| Constructor Summary | |
|---|---|
protected |
LogCommand(Repository repo)
|
| Method Summary | |
|---|---|
LogCommand |
add(AnyObjectId start)
Mark a commit to start graph traversal from. |
LogCommand |
addPath(String path)
Show only commits that affect any of the specified paths. |
LogCommand |
addRange(AnyObjectId since,
AnyObjectId until)
Adds the range since..until |
LogCommand |
all()
Add all refs as commits to start the graph traversal from. |
Iterable<RevCommit> |
call()
Executes the Log command with all the options and parameters
collected by the setter methods (e.g. |
LogCommand |
not(AnyObjectId start)
Same as --not start, or ^start |
LogCommand |
setMaxCount(int maxCount)
Limit the number of commits to output |
| Methods inherited from class org.eclipse.jgit.api.GitCommand |
|---|
checkCallable, getRepository, setCallable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected LogCommand(Repository repo)
repo - | Method Detail |
|---|
public Iterable<RevCommit> call()
throws NoHeadException,
JGitInternalException
Log command with all the options and parameters
collected by the setter methods (e.g. add(AnyObjectId),
not(AnyObjectId), ..) of this class. Each instance of this class
should only be used for one invocation of the command. Don't call this
method twice on an instance.
NoHeadException
JGitInternalException
public LogCommand add(AnyObjectId start)
throws MissingObjectException,
IncorrectObjectTypeException,
JGitInternalException
start -
this
MissingObjectException - the commit supplied is not available from the object
database. This usually indicates the supplied commit is
invalid, but the reference was constructed during an earlier
invocation to RevWalk.lookupCommit(AnyObjectId).
IncorrectObjectTypeException - the object was not parsed yet and it was discovered during
parsing that it is not actually a commit. This usually
indicates the caller supplied a non-commit SHA-1 to
RevWalk.lookupCommit(AnyObjectId).
JGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause(). Expect only
IOException's to be wrapped. Subclasses of
IOException (e.g. MissingObjectException) are
typically not wrapped here but thrown as original exceptionRevWalk.markStart(RevCommit)
public LogCommand not(AnyObjectId start)
throws MissingObjectException,
IncorrectObjectTypeException,
JGitInternalException
--not start, or ^start
start -
this
MissingObjectException - the commit supplied is not available from the object
database. This usually indicates the supplied commit is
invalid, but the reference was constructed during an earlier
invocation to RevWalk.lookupCommit(AnyObjectId).
IncorrectObjectTypeException - the object was not parsed yet and it was discovered during
parsing that it is not actually a commit. This usually
indicates the caller supplied a non-commit SHA-1 to
RevWalk.lookupCommit(AnyObjectId).
JGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause(). Expect only
IOException's to be wrapped. Subclasses of
IOException (e.g. MissingObjectException) are
typically not wrapped here but thrown as original exception
public LogCommand addRange(AnyObjectId since,
AnyObjectId until)
throws MissingObjectException,
IncorrectObjectTypeException,
JGitInternalException
since..until
since - until -
this
MissingObjectException - the commit supplied is not available from the object
database. This usually indicates the supplied commit is
invalid, but the reference was constructed during an earlier
invocation to RevWalk.lookupCommit(AnyObjectId).
IncorrectObjectTypeException - the object was not parsed yet and it was discovered during
parsing that it is not actually a commit. This usually
indicates the caller supplied a non-commit SHA-1 to
RevWalk.lookupCommit(AnyObjectId).
JGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause(). Expect only
IOException's to be wrapped. Subclasses of
IOException (e.g. MissingObjectException) are
typically not wrapped here but thrown as original exception
public LogCommand all()
throws IOException
this
IOException - the references could not be accessedadd(AnyObjectId)public LogCommand addPath(String path)
path - a path is relative to the top level of the repository
thispublic LogCommand setMaxCount(int maxCount)
maxCount - the limit
this
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||