public class DescribeCommand extends GitCommand<String>
repo
Modifier | Constructor and Description |
---|---|
protected |
DescribeCommand(Repository repo)
Constructor for DescribeCommand.
|
Modifier and Type | Method and Description |
---|---|
String |
call() |
DescribeCommand |
setAlways(boolean always)
Always describe the commit by eventually falling back to a uniquely
abbreviated commit hash if no other name matches.
|
DescribeCommand |
setLong(boolean longDesc)
Determine whether always to use the long format or not.
|
DescribeCommand |
setMatch(String... patterns)
Sets one or more
glob(7) patterns that tags must match to be
considered. |
DescribeCommand |
setTags(boolean tags)
Instead of using only the annotated tags, use any tag found in refs/tags
namespace.
|
DescribeCommand |
setTarget(ObjectId target)
Sets the commit to be described.
|
DescribeCommand |
setTarget(String rev)
Sets the commit to be described.
|
checkCallable, getRepository, setCallable
protected DescribeCommand(Repository repo)
repo
- the Repository
public DescribeCommand setTarget(ObjectId target) throws IOException
target
- A non-null object ID to be described.this
MissingObjectException
- the supplied commit does not exist.IncorrectObjectTypeException
- the supplied id is not a commit or an annotated tag.IOException
- a pack file or loose object could not be read.public DescribeCommand setTarget(String rev) throws IOException, RefNotFoundException
rev
- Commit ID, tag, branch, ref, etc. See
Repository.resolve(String)
for
allowed syntax.this
IncorrectObjectTypeException
- the supplied id is not a commit or an annotated tag.RefNotFoundException
- the given rev didn't resolve to any object.IOException
- a pack file or loose object could not be read.public DescribeCommand setLong(boolean longDesc)
true
the long format is used even the commit matches a tag.longDesc
- true
if always the long format should be used.this
public DescribeCommand setTags(boolean tags)
tags
- true
enables matching lightweight (non-annotated)
tags like setting option --tags in c gitthis
public DescribeCommand setAlways(boolean always)
always
- true
enables falling back to a uniquely
abbreviated commit hashthis
public DescribeCommand setMatch(String... patterns) throws InvalidPatternException
glob(7)
patterns that tags must match to be
considered. If multiple patterns are provided, tags only need match one
of them.patterns
- the glob(7)
pattern or patternsthis
InvalidPatternException
- if the pattern passed in was invalid.public String call() throws GitAPIException
Execute the command
Describes the specified commit. Target defaults to HEAD if no commit was set explicitly.
call
in interface Callable<String>
call
in class GitCommand<String>
GitAPIException
Copyright © 2020 Eclipse JGit Project. All rights reserved.