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())
Examples (git is a org. 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();
Get commits only for a specific file:
git.log().add(head).addPath("dir/filename.txt").call();
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private int | |
| private final List | |
| private RevFilter | |
| private int | |
| private boolean | |
| private RevWalk |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public LogCommand | Returns: thisthe id of the commit to start from start)Mark a commit to start graph traversal from. |
| private LogCommand | |
| public LogCommand | |
| public LogCommand | Returns: thisa since, AnyObjectId org. object.a until)org. object.Adds the range |
| public LogCommand | |
| public Iterable | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| public LogCommand | Returns: thisa repository-relative path (with path)/ as separator)Show all commits that are not within any of the specified paths. |
| public LogCommand | |
| public LogCommand | |
| public LogCommand | Returns: thisthe filter that this instance of aFilter)LogCommand
should useSet a filter for the |
| public LogCommand | Returns: thisthe number of commits to skip skip)Skip the number of commits before starting to show the commit output. |
| excludeTreeFilters | back to summary |
|---|---|
| private final List<TreeFilter> excludeTreeFilters | |
| maxCount | back to summary |
|---|---|
| private int maxCount | |
| pathFilters | back to summary |
|---|---|
| private final List<PathFilter> pathFilters | |
| revFilter | back to summary |
|---|---|
| private RevFilter revFilter | |
| skip | back to summary |
|---|---|
| private int skip | |
| startSpecified | back to summary |
|---|---|
| private boolean startSpecified | |
| walk | back to summary |
|---|---|
| private RevWalk walk | |
| LogCommand | back to summary |
|---|---|
| protected LogCommand(Repository repo) Constructor for LogCommand.
| |
| add | back to summary |
|---|---|
| public LogCommand add(AnyObjectId start) throws MissingObjectException, IncorrectObjectTypeException Mark a commit to start graph traversal from.
| |
| add | back to summary |
|---|---|
| private LogCommand add(boolean include, AnyObjectId start) throws MissingObjectException, IncorrectObjectTypeException, JGitInternalException | |
| addPath | back to summary |
|---|---|
| public LogCommand addPath(String path) Show only commits that affect any of the specified paths. The path must
either name a file or a directory exactly and use
| |
| addRange | back to summary |
|---|---|
| public LogCommand addRange(AnyObjectId since, AnyObjectId until) throws MissingObjectException, IncorrectObjectTypeException Adds the range
| |
| all | back to summary |
|---|---|
| public LogCommand all() throws IOException Add all refs as commits to start the graph traversal from.
| |
| call | back to summary |
|---|---|
| public Iterable Implements abstract org. Implements java. Doc from org. Computes a result, or throws an exception if unable to do so. Execute the command
Executes the
| |
| excludePath | back to summary |
|---|---|
| public LogCommand excludePath(String path) Show all commits that are not within any of the specified paths. The path
must either name a file or a directory exactly and use
| |
| not | back to summary |
|---|---|
| public LogCommand not(AnyObjectId start) throws MissingObjectException, IncorrectObjectTypeException Same as
| |
| setMaxCount | back to summary |
|---|---|
| public LogCommand setMaxCount(int maxCount) Limit the number of commits to output.
| |
| setRevFilter | back to summary |
|---|---|
| public LogCommand setRevFilter(RevFilter aFilter) Set a filter for the
| |
| setSkip | back to summary |
|---|---|
| public LogCommand setSkip(int skip) Skip the number of commits before starting to show the commit output.
| |