Package org.eclipse.jgit.api
Class BlameCommand
- All Implemented Interfaces:
Callable<BlameResult>
Blame command for building a
BlameResult
for a
file path.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DiffAlgorithm
private Boolean
private String
private Collection
<ObjectId> private ObjectId
private RawTextComparator
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()
reverse
(AnyObjectId start, Collection<ObjectId> end) Configure the generator to compute reverse blame (history of deletes).reverse
(AnyObjectId start, AnyObjectId end) Configure the command to compute reverse blame (history of deletes).setDiffAlgorithm
(DiffAlgorithm diffAlgorithm) Set diff algorithmsetFilePath
(String filePath) Set file path.setFollowFileRenames
(boolean follow) Enable (or disable) following file renames.setStartCommit
(AnyObjectId commit) Set start commit idsetTextComparator
(RawTextComparator textComparator) Set raw text comparatorMethods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
path
-
diffAlgorithm
-
textComparator
-
startCommit
-
reverseEndCommits
-
followFileRenames
-
-
Constructor Details
-
BlameCommand
Constructor for BlameCommand- Parameters:
repo
- theRepository
-
-
Method Details
-
setFilePath
Set file path.- Parameters:
filePath
- file path (with/
as separator)- Returns:
- this command
-
setDiffAlgorithm
Set diff algorithm- Parameters:
diffAlgorithm
- aDiffAlgorithm
object.- Returns:
- this command
-
setTextComparator
Set raw text comparator- Parameters:
textComparator
- aRawTextComparator
- Returns:
- this command
-
setStartCommit
Set start commit id- Parameters:
commit
- id of a commit- Returns:
- this command
-
setFollowFileRenames
Enable (or disable) following file renames.If true renames are followed using the standard FollowFilter behavior used by RevWalk (which matches
git log --follow
in the C implementation). This is not the same as copy/move detection as implemented by the C implementation's ofgit blame -M -C
.- Parameters:
follow
- enable following.- Returns:
this
-
reverse
Configure the command to compute reverse blame (history of deletes).- Parameters:
start
- oldest commit to traverse from. The result file will be loaded from this commit's tree.end
- most recent commit to stop traversal at. Usually an active branch tip, tag, or HEAD.- Returns:
this
- Throws:
IOException
- the repository cannot be read.
-
reverse
Configure the generator to compute reverse blame (history of deletes).- Parameters:
start
- oldest commit to traverse from. The result file will be loaded from this commit's tree.end
- most recent commits to stop traversal at. Usually an active branch tip, tag, or HEAD.- Returns:
this
- Throws:
IOException
- the repository cannot be read.
-
call
Execute the command
Generate a list of lines with information about when the lines were introduced into the file path.
- Specified by:
call
in interfaceCallable<BlameResult>
- Specified by:
call
in classGitCommand<BlameResult>
- Throws:
GitAPIException
-