public class DescribeCommand extends org.eclipse.jgit.api.GitCommand<DescribeResult>
describecommand.
| Modifier and Type | Method and Description |
|---|---|
DescribeCommand |
abbrev(java.lang.Integer n)
--abbrev=N
|
DescribeCommand |
always(boolean always)
--always
|
DescribeCommand |
apply(GitDescribeConfig config)
Apply all configuration options passed in with `config`.
|
DescribeResult |
call() |
DescribeCommand |
dirty(java.lang.String dirtyMarker)
--dirty[=mark]
|
DescribeCommand |
forceLongFormat(java.lang.Boolean forceLongFormat)
--long
|
DescribeCommand |
match(java.lang.String pattern)
--match glob-pattern
|
static DescribeCommand |
on(java.lang.String evaluateOnCommit,
org.eclipse.jgit.lib.Repository repo,
LoggerBridge log)
Creates a new describe command which interacts with a single repository
|
DescribeCommand |
tags()
Alias for
tags(Boolean) with true value |
DescribeCommand |
tags(java.lang.Boolean includeLightweightTagsInSearch)
--tags
|
@Nonnull public static DescribeCommand on(java.lang.String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, LoggerBridge log)
repo - the Repository this command should interact withlog - logger bridge to direct logs to@Nonnull public DescribeCommand always(boolean always)
--alwaysShow uniquely abbreviated commit object as fallback.
trueby default.
@Nonnull public DescribeCommand forceLongFormat(@Nullable java.lang.Boolean forceLongFormat)
--longAlways output the long format (the tag, the number of commits and the abbreviated commit name) even when it matches a tag. This is useful when you want to see parts of the commit object name in "describe" output, even when the commit in question happens to be a tagged version. Instead of just emitting the tag name, it will describe such a commit as v1.2-0-gdeadbee (0th commit since tag v1.2 that points at object deadbee....).
falseby default.
@Nonnull public DescribeCommand abbrev(@Nullable java.lang.Integer n)
--abbrev=NInstead of using the default 7 hexadecimal digits as the abbreviated object name, use N digits, or as many digits as needed to form a unique object name. An `n` of 0 will suppress long format, only showing the closest tag.
@Nonnull public DescribeCommand tags(@Nullable java.lang.Boolean includeLightweightTagsInSearch)
--tags
Instead of using only the annotated tags, use any tag found in .git/refs/tags. This option enables matching a lightweight (non-annotated) tag.
Searching for lightweight tags is false by default.
Example:
b6a73ed - (HEAD, master)
d37a598 - (v1.0-fixed-stuff) - a lightweight tag (with no message)
9597545 - (v1.0) - an annotated tag
$ git describe
annotated-tag-2-gb6a73ed # the nearest "annotated" tag is found
$ git describe --tags
lightweight-tag-1-gb6a73ed # the nearest tag (including lightweights) is found
Using only annotated tags to mark builds may be useful if you're using tags to help yourself with annotating things like "i'll get back to that" etc - you don't need such tags to be exposed. But if you want lightweight tags to be included in the search, enable this option.
public DescribeCommand tags()
tags(Boolean) with true value@Nonnull public DescribeCommand apply(@Nullable GitDescribeConfig config)
@Nonnull public DescribeCommand dirty(@Nullable java.lang.String dirtyMarker)
--dirty[=mark]Describe the working tree. It means describe HEAD and appends mark (
-dirtyby default) if the working tree is dirty.
dirtyMarker - the marker name to be appended to the describe output when the workspace is dirty@Nonnull public DescribeCommand match(@Nullable java.lang.String pattern)
--match glob-patternConsider only those tags which match the given glob pattern.
pattern - the glob style pattern to match against the tag namespublic DescribeResult call() throws org.eclipse.jgit.api.errors.GitAPIException
call in interface java.util.concurrent.Callable<DescribeResult>call in class org.eclipse.jgit.api.GitCommand<DescribeResult>org.eclipse.jgit.api.errors.GitAPIExceptionCopyright © 2020. All Rights Reserved.