This is an abstract interface. Applications may implement a subclass, or use
one of the predefined implementations already available within this package.
Filters may be chained together using AndRevFilter and
OrRevFilter to create complex boolean expressions.
Applications should install the filter on a RevWalk by
org. prior to
starting traversal.
Unless specifically noted otherwise a RevFilter implementation is not thread
safe and may not be shared by different RevWalk instances at the same time.
This restriction allows RevFilter implementations to cache state within their
instances during include(RevWalk, RevCommit) if it is beneficial to
their implementation. Deep clones created by clone() may be used to
construct a thread-safe copy of an existing filter.
Message filters:
org.eclipse.jgit.revwalk.filter.AuthorRevFilter org.eclipse.jgit.revwalk.filter.CommitterRevFilter org.eclipse.jgit.revwalk.filter.MessageRevFilter Merge filters:
NO_MERGES.ONLY_MERGESBoolean modifiers:
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final RevFilter | ALL
Default filter that always returns true (thread safe). |
| public static final RevFilter | MERGE_BASE
Selects only merge bases of the starting points (thread safe). |
| public static final RevFilter | NO_MERGES
Excludes commits with more than one parent (thread safe). |
| public static final RevFilter | NONE
Default filter that always returns false (thread safe). |
| public static final RevFilter | ONLY_MERGES
Filter including only merge commits, excluding all commits with less than two parents (thread safe). |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract RevFilter | |
| public abstract boolean | Returns: true to include this commit in the results; false to have this commit be omitted entirely from the results.the active walker this filter is being invoked from within. walker, RevCommit the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from cmit)requiresCommitBody().Determine if the supplied commit should be included in results. |
| public RevFilter | Returns: a new filter that includes commits this filter rejects.Create a new filter that does the opposite of this filter. |
| public boolean | Returns: true if the filter needs the commit body to be parsed.Whether the filter needs the commit body to be parsed. |
| public String |
| ALL | back to summary |
|---|---|
| public static final RevFilter ALL Default filter that always returns true (thread safe). | |
| MERGE_BASE | back to summary |
|---|---|
| public static final RevFilter MERGE_BASE Selects only merge bases of the starting points (thread safe). This is a special case filter that cannot be combined with any other filter. Its include method always throws an exception as context information beyond the arguments is necessary to determine if the supplied commit is a merge base. | |
| NO_MERGES | back to summary |
|---|---|
| public static final RevFilter NO_MERGES Excludes commits with more than one parent (thread safe). | |
| NONE | back to summary |
|---|---|
| public static final RevFilter NONE Default filter that always returns false (thread safe). | |
| ONLY_MERGES | back to summary |
|---|---|
| public static final RevFilter ONLY_MERGES Filter including only merge commits, excluding all commits with less than two parents (thread safe).
| |
| RevFilter | back to summary |
|---|---|
| public RevFilter() | |
| clone | back to summary |
|---|---|
| public abstract RevFilter clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by Clone this revision filter, including its parameters. This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data. | |
| include | back to summary |
|---|---|
| public abstract boolean include(RevWalk walker, RevCommit cmit) throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException Determine if the supplied commit should be included in results.
| |
| negate | back to summary |
|---|---|
| public RevFilter negate() Create a new filter that does the opposite of this filter.
| |
| requiresCommitBody | back to summary |
|---|---|
| public boolean requiresCommitBody() Whether the filter needs the commit body to be parsed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public RevFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public boolean | include(RevWalk
the active walker this filter is being invoked from within. walker, RevCommit the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from c)requiresCommitBody().Implements abstract org. Determine if the supplied commit should be included in results. |
| public boolean | requiresCommitBody()
Overrides org. Whether the filter needs the commit body to be parsed. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| AllFilter | back to summary |
|---|---|
| private AllFilter() | |
| clone | back to summary |
|---|---|
| public RevFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by Clone this revision filter, including its parameters. This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| include | back to summary |
|---|---|
| public boolean include(RevWalk walker, RevCommit c) Implements abstract org. Doc from org. Determine if the supplied commit should be included in results.
| |
| requiresCommitBody | back to summary |
|---|---|
| public boolean requiresCommitBody() Overrides org. Doc from org. Whether the filter needs the commit body to be parsed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public RevFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public boolean | include(RevWalk
the active walker this filter is being invoked from within. walker, RevCommit the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from c)requiresCommitBody().Implements abstract org. Determine if the supplied commit should be included in results. |
| public boolean | requiresCommitBody()
Overrides org. Whether the filter needs the commit body to be parsed. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| MergeBaseFilter | back to summary |
|---|---|
| private MergeBaseFilter() | |
| clone | back to summary |
|---|---|
| public RevFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by Clone this revision filter, including its parameters. This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| include | back to summary |
|---|---|
| public boolean include(RevWalk walker, RevCommit c) Implements abstract org. Doc from org. Determine if the supplied commit should be included in results.
| |
| requiresCommitBody | back to summary |
|---|---|
| public boolean requiresCommitBody() Overrides org. Doc from org. Whether the filter needs the commit body to be parsed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public RevFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public boolean | include(RevWalk
the active walker this filter is being invoked from within. walker, RevCommit the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from c)requiresCommitBody().Implements abstract org. Determine if the supplied commit should be included in results. |
| public boolean | requiresCommitBody()
Overrides org. Whether the filter needs the commit body to be parsed. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| NoMergesFilter | back to summary |
|---|---|
| private NoMergesFilter() | |
| clone | back to summary |
|---|---|
| public RevFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by Clone this revision filter, including its parameters. This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| include | back to summary |
|---|---|
| public boolean include(RevWalk walker, RevCommit c) Implements abstract org. Doc from org. Determine if the supplied commit should be included in results.
| |
| requiresCommitBody | back to summary |
|---|---|
| public boolean requiresCommitBody() Overrides org. Doc from org. Whether the filter needs the commit body to be parsed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public RevFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public boolean | include(RevWalk
the active walker this filter is being invoked from within. walker, RevCommit the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from c)requiresCommitBody().Implements abstract org. Determine if the supplied commit should be included in results. |
| public boolean | requiresCommitBody()
Overrides org. Whether the filter needs the commit body to be parsed. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| NoneFilter | back to summary |
|---|---|
| private NoneFilter() | |
| clone | back to summary |
|---|---|
| public RevFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by Clone this revision filter, including its parameters. This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| include | back to summary |
|---|---|
| public boolean include(RevWalk walker, RevCommit c) Implements abstract org. Doc from org. Determine if the supplied commit should be included in results.
| |
| requiresCommitBody | back to summary |
|---|---|
| public boolean requiresCommitBody() Overrides org. Doc from org. Whether the filter needs the commit body to be parsed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public RevFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public boolean | include(RevWalk
the active walker this filter is being invoked from within. walker, RevCommit the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from c)requiresCommitBody().Implements abstract org. Determine if the supplied commit should be included in results. |
| public boolean | requiresCommitBody()
Overrides org. Whether the filter needs the commit body to be parsed. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| OnlyMergesFilter | back to summary |
|---|---|
| private OnlyMergesFilter() | |
| clone | back to summary |
|---|---|
| public RevFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by Clone this revision filter, including its parameters. This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| include | back to summary |
|---|---|
| public boolean include(RevWalk walker, RevCommit c) Implements abstract org. Doc from org. Determine if the supplied commit should be included in results.
| |
| requiresCommitBody | back to summary |
|---|---|
| public boolean requiresCommitBody() Overrides org. Doc from org. Whether the filter needs the commit body to be parsed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |