Package org.eclipse.jgit.api
Class NameRevCommand
Command to find human-readable names of revisions.
- Since:
- 3.0
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Amount of slop to allow walking past the earliest requested commit.private static final int
Cost of traversing a merge commit compared to a linear history.private int
private final RevWalk
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
NameRevCommand
(Repository repo) Create a new name-rev command. -
Method Summary
Modifier and TypeMethodDescriptionAdd multiple objects to search for.Add an object to search for.Add all annotated tags underrefs/tags/
to the set that all results must match.Add a ref prefix to the set that results must match.private void
private void
addPrefixes
(Map<ObjectId, String> nonCommits, FIFORevQueue pending) Add a ref to the set that all results must match.private void
call()
private long
private int
(package private) NameRevCommand
setMergeCost
(int cost) private static String
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
COMMIT_TIME_SLOP
private static final int COMMIT_TIME_SLOPAmount of slop to allow walking past the earliest requested commit.- See Also:
-
MERGE_COST
private static final int MERGE_COSTCost of traversing a merge commit compared to a linear history.- See Also:
-
walk
-
prefixes
-
revs
-
refs
-
mergeCost
private int mergeCost
-
-
Constructor Details
-
NameRevCommand
Create a new name-rev command.- Parameters:
repo
- theRepository
-
-
Method Details
-
call
Execute the command
-
add
Add an object to search for.- Parameters:
id
- object ID to add.- Returns:
this
- Throws:
MissingObjectException
- the object supplied is not available from the object database.JGitInternalException
- a low-level exception of JGit has occurred. The original exception can be retrieved by callingThrowable.getCause()
.
-
add
public NameRevCommand add(Iterable<ObjectId> ids) throws MissingObjectException, JGitInternalException Add multiple objects to search for.- Parameters:
ids
- object IDs to add.- Returns:
this
- Throws:
MissingObjectException
- the object supplied is not available from the object database.JGitInternalException
- a low-level exception of JGit has occurred. The original exception can be retrieved by callingThrowable.getCause()
.
-
addPrefix
Add a ref prefix to the set that results must match.If an object matches multiple refs equally well, the first matching ref added with
addRef(Ref)
is preferred, or else the first matching prefix added byaddPrefix(String)
.- Parameters:
prefix
- prefix to add; the prefix must end with a slash- Returns:
this
-
addAnnotatedTags
Add all annotated tags underrefs/tags/
to the set that all results must match.Calls
addRef(Ref)
; see that method for a note on matching priority.- Returns:
this
- Throws:
JGitInternalException
- a low-level exception of JGit has occurred. The original exception can be retrieved by callingThrowable.getCause()
.
-
addRef
Add a ref to the set that all results must match.If an object matches multiple refs equally well, the first matching ref added with
addRef(Ref)
is preferred, or else the first matching prefix added byaddPrefix(String)
.- Parameters:
ref
- ref to add.- Returns:
this
-
setMergeCost
-
addPrefixes
- Throws:
IOException
-
addPrefix
private void addPrefix(String prefix, Map<ObjectId, String> nonCommits, FIFORevQueue pending) throws IOException- Throws:
IOException
-
addRef
private void addRef(Ref ref, Map<ObjectId, String> nonCommits, FIFORevQueue pending) throws IOException- Throws:
IOException
-
minCommitTime
- Throws:
IOException
-
compare
-
simplify
-