Top Description Fields Constructors Methods
org.eclipse.jgit.api

public Class BlameCommand

extends GitCommand<BlameResult>
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .Collection, .Collections, org.eclipse.jgit.api.errors.GitAPIException, .JGitInternalException, org.eclipse.jgit.blame.BlameGenerator, .BlameResult, org.eclipse.jgit.diff.DiffAlgorithm, .RawTextComparator, org.eclipse.jgit.lib.AnyObjectId, .ObjectId, .Repository

Blame command for building a org.eclipse.jgit.blame.BlameResult for a file path.

Field Summary

Modifier and TypeField and Description
private DiffAlgorithm
private Boolean
private String
private Collection<ObjectId>
private ObjectId
private RawTextComparator
Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
public
BlameCommand(Repository repo)

Constructor for BlameCommand

Method Summary

Modifier and TypeMethod and Description
public BlameResult
call()

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

public BlameCommand

Returns:

this
reverse
(AnyObjectId
oldest commit to traverse from. The result file will be loaded from this commit's tree.
start
,
AnyObjectId
most recent commit to stop traversal at. Usually an active branch tip, tag, or HEAD.
end
)

Configure the command to compute reverse blame (history of deletes).

public BlameCommand

Returns:

this
reverse
(AnyObjectId
oldest commit to traverse from. The result file will be loaded from this commit's tree.
start
,
Collection<ObjectId>
most recent commits to stop traversal at. Usually an active branch tip, tag, or HEAD.
end
)

Configure the generator to compute reverse blame (history of deletes).

public BlameCommand

Returns:

this command
setDiffAlgorithm
(DiffAlgorithm diffAlgorithm)

Set diff algorithm

public BlameCommand

Returns:

this command
setFilePath
(String
file path (with / as separator)
filePath
)

Set file path.

public BlameCommand

Returns:

this
setFollowFileRenames
(boolean
enable following.
follow
)

Enable (or disable) following file renames.

public BlameCommand

Returns:

this command
setStartCommit
(AnyObjectId
id of a commit
commit
)

Set start commit id

public BlameCommand

Returns:

this command
setTextComparator
(RawTextComparator textComparator)

Set raw text comparator

Inherited from org.eclipse.jgit.api.GitCommand:
checkCallablegetRepositorysetCallable

Field Detail

diffAlgorithmback to summary
private DiffAlgorithm diffAlgorithm
followFileRenamesback to summary
private Boolean followFileRenames
pathback to summary
private String path
reverseEndCommitsback to summary
private Collection<ObjectId> reverseEndCommits
startCommitback to summary
private ObjectId startCommit
textComparatorback to summary
private RawTextComparator textComparator

Constructor Detail

BlameCommandback to summary
public BlameCommand(Repository repo)

Constructor for BlameCommand

Parameters
repo:Repository

the org.eclipse.jgit.lib.Repository

Method Detail

callback to summary
public BlameResult call() throws GitAPIException

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Doc from org.eclipse.jgit.api.GitCommand.call.

Computes a result, or throws an exception if unable to do so.

Execute the command

Generate a list of lines with information about when the lines were introduced into the file path.

Returns:BlameResult

Doc from java.util.concurrent.Callable.call.

computed result

Annotations
@Override
reverseback to summary
public BlameCommand reverse(AnyObjectId start, AnyObjectId end) throws IOException

Configure the command to compute reverse blame (history of deletes).

Parameters
start:AnyObjectId

oldest commit to traverse from. The result file will be loaded from this commit's tree.

end:AnyObjectId

most recent commit to stop traversal at. Usually an active branch tip, tag, or HEAD.

Returns:BlameCommand

this

Exceptions
IOException:
the repository cannot be read.
reverseback to summary
public BlameCommand reverse(AnyObjectId start, Collection<ObjectId> end) throws IOException

Configure the generator to compute reverse blame (history of deletes).

Parameters
start:AnyObjectId

oldest commit to traverse from. The result file will be loaded from this commit's tree.

end:Collection<ObjectId>

most recent commits to stop traversal at. Usually an active branch tip, tag, or HEAD.

Returns:BlameCommand

this

Exceptions
IOException:
the repository cannot be read.
setDiffAlgorithmback to summary
public BlameCommand setDiffAlgorithm(DiffAlgorithm diffAlgorithm)

Set diff algorithm

Parameters
diffAlgorithm:DiffAlgorithm

a org.eclipse.jgit.diff.DiffAlgorithm object.

Returns:BlameCommand

this command

setFilePathback to summary
public BlameCommand setFilePath(String filePath)

Set file path.

Parameters
filePath:String

file path (with / as separator)

Returns:BlameCommand

this command

setFollowFileRenamesback to summary
public BlameCommand setFollowFileRenames(boolean follow)

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 of git blame -M -C.

Parameters
follow:boolean

enable following.

Returns:BlameCommand

this

setStartCommitback to summary
public BlameCommand setStartCommit(AnyObjectId commit)

Set start commit id

Parameters
commit:AnyObjectId

id of a commit

Returns:BlameCommand

this command

setTextComparatorback to summary
public BlameCommand setTextComparator(RawTextComparator textComparator)

Set raw text comparator

Parameters
textComparator:RawTextComparator

a org.eclipse.jgit.diff.RawTextComparator

Returns:BlameCommand

this command