Top Description Inners Fields Constructors Methods
org.eclipse.jgit.blame

pack-priv Class Candidate

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.blame.Candidate.ReverseCandidate, org.eclipse.jgit.blame.Candidate.HeadCandidate, org.eclipse.jgit.blame.Candidate.BlobCandidate
Imports
java.io.IOException, java.util.List, .Objects, org.eclipse.jgit.blame.ReverseWalk.ReverseCommit, org.eclipse.jgit.diff.Edit, .EditList, .RawText, org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.Constants, .ObjectId, .ObjectLoader, .ObjectReader, .PersonIdent, .Repository, org.eclipse.jgit.revwalk.RevCommit, .RevFlag, .RevWalk, org.eclipse.jgit.treewalk.filter.PathFilter, org.eclipse.jgit.util.LfsFactory

A source that may have supplied some (or all) of the result file.

Candidates are kept in a queue by BlameGenerator, allowing the generator to perform a parallel search down the parents of any merges that are discovered during the history traversal. Each candidate retains a regionList describing sections of the result file the candidate has taken responsibility for either directly or indirectly through its history. Actual blame from this region list will be assigned to the candidate when its ancestor commit(s) are themselves converted into Candidate objects and the ancestor's candidate uses takeBlame(EditList, Candidate) to accept responsibility for sections of the result.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
Candidate.BlobCandidate

Candidate loaded from a file source, and not a commit.

pack-priv static class
Candidate.HeadCandidate

A Candidate to blame a working tree file in conflict state.

pack-priv static class
Candidate.ReverseCandidate

Special candidate type used for reverse blame.

Field Summary

Modifier and TypeField and Description
pack-priv Candidate
queueNext

Next candidate in the candidate queue.

pack-priv Region
regionList

Chain of regions this candidate may be blamed for.

pack-priv int
renameScore

Score assigned to the rename to this candidate.

pack-priv ObjectId
sourceBlob

Unique name of the candidate blob in sourceCommit.

pack-priv RevCommit
sourceCommit

Commit being considered (or blamed, depending on state).

pack-priv PathFilter
sourcePath

Path of the candidate file in sourceCommit.

private Repository
sourceRepository

repository used for LFS blob handling

pack-priv RawText
sourceText

Complete contents of the file in sourceCommit.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
add(RevFlag flag)

private static Region
add(Region aTail, Candidate a, Region n)

pack-priv void
private static void
pack-priv boolean
private Region
pack-priv Candidate
copy(RevCommit commit)

pack-priv Candidate
create(Repository repo, RevCommit commit, PathFilter path)

pack-priv PersonIdent
pack-priv Candidate
pack-priv RevCommit
getParent(int idx)

pack-priv int
pack-priv int
pack-priv boolean
has(RevFlag flag)

pack-priv void
pack-priv void
pack-priv void
pack-priv void
takeBlame(EditList editList, Candidate child)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

queueNextback to summary
pack-priv Candidate queueNext

Next candidate in the candidate queue.

regionListback to summary
pack-priv Region regionList

Chain of regions this candidate may be blamed for.

This list is always kept sorted by resultStart order, making it simple to merge-join with the sorted EditList during blame assignment.

renameScoreback to summary
pack-priv int renameScore

Score assigned to the rename to this candidate.

Consider the history "A<-B<-C". If the result file S in C was renamed to R in B, the rename score for this rename will be held in this field by the candidate object for B. By storing the score with B, the application can see what the rename score was as it makes the transition from C/S to B/R. This may seem backwards since it was C that performed the rename, but the application doesn't learn about path R until B.

sourceBlobback to summary
pack-priv ObjectId sourceBlob

Unique name of the candidate blob in sourceCommit.

sourceCommitback to summary
pack-priv RevCommit sourceCommit

Commit being considered (or blamed, depending on state).

sourcePathback to summary
pack-priv PathFilter sourcePath

Path of the candidate file in sourceCommit.

sourceRepositoryback to summary
private Repository sourceRepository

repository used for LFS blob handling

sourceTextback to summary
pack-priv RawText sourceText

Complete contents of the file in sourceCommit.

Constructor Detail

Candidateback to summary
pack-priv Candidate(Repository repo, RevCommit commit, PathFilter path)

Method Detail

addback to summary
pack-priv void add(RevFlag flag)
addback to summary
private static Region add(Region aTail, Candidate a, Region n)
beginResultback to summary
pack-priv void beginResult(RevWalk rw) throws MissingObjectException, IOException
blameback to summary
private static void blame(EditList editList, Candidate a, Candidate b)
canMergeRegionsback to summary
pack-priv boolean canMergeRegions(Candidate other)
clearRegionListback to summary
private Region clearRegionList()
copyback to summary
pack-priv Candidate copy(RevCommit commit)
createback to summary
pack-priv Candidate create(Repository repo, RevCommit commit, PathFilter path)
getAuthorback to summary
pack-priv PersonIdent getAuthor()
getNextCandidateback to summary
pack-priv Candidate getNextCandidate(int idx)
getParentback to summary
pack-priv RevCommit getParent(int idx)
getParentCountback to summary
pack-priv int getParentCount()
getTimeback to summary
pack-priv int getTime()
hasback to summary
pack-priv boolean has(RevFlag flag)
loadTextback to summary
pack-priv void loadText(ObjectReader reader) throws IOException
mergeRegionsback to summary
pack-priv void mergeRegions(Candidate other)
removeback to summary
pack-priv void remove(RevFlag flag)
takeBlameback to summary
pack-priv void takeBlame(EditList editList, Candidate child)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@SuppressWarnings:nls
@Override
org.eclipse.jgit.blame back to summary

pack-priv final Class Candidate.BlobCandidate

extends Candidate
Class Inheritance

Candidate loaded from a file source, and not a commit.

The Candidate#sourceCommit field is always null on this type of candidate. Instead history traversal follows the single parent field to discover the next Candidate. Often this is a normal Candidate type that has a valid sourceCommit.

Field Summary

Modifier and TypeField and Description
pack-priv String
description

Author name to refer to this blob with.

pack-priv Candidate
parent

Next candidate to pass blame onto.

Inherited from org.eclipse.jgit.blame.Candidate:
queueNextregionListrenameScoresourceBlobsourceCommitsourcePathsourceText

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv PersonIdent
pack-priv Candidate
pack-priv RevCommit
pack-priv int
pack-priv int
pack-priv boolean
pack-priv void
Inherited from org.eclipse.jgit.blame.Candidate:
canMergeRegionscopycreateloadTextmergeRegionstakeBlametoString

Field Detail

descriptionback to summary
pack-priv String description

Author name to refer to this blob with.

parentback to summary
pack-priv Candidate parent

Next candidate to pass blame onto.

When computing the differences that this candidate introduced to the file content, the parent's sourceText is used as the base.

Constructor Detail

BlobCandidateback to summary
pack-priv BlobCandidate(Repository repo, String name, PathFilter path)

Method Detail

addback to summary
pack-priv void add(RevFlag flag)

Overrides org.eclipse.jgit.blame.Candidate.add.

Annotations
@Override
beginResultback to summary
pack-priv void beginResult(RevWalk rw)

Overrides org.eclipse.jgit.blame.Candidate.beginResult.

Annotations
@Override
getAuthorback to summary
pack-priv PersonIdent getAuthor()

Overrides org.eclipse.jgit.blame.Candidate.getAuthor.

Annotations
@Override
getNextCandidateback to summary
pack-priv Candidate getNextCandidate(int idx)

Overrides org.eclipse.jgit.blame.Candidate.getNextCandidate.

Annotations
@Override
getParentback to summary
pack-priv RevCommit getParent(int idx)

Overrides org.eclipse.jgit.blame.Candidate.getParent.

Annotations
@Override
getParentCountback to summary
pack-priv int getParentCount()

Overrides org.eclipse.jgit.blame.Candidate.getParentCount.

Annotations
@Override
getTimeback to summary
pack-priv int getTime()

Overrides org.eclipse.jgit.blame.Candidate.getTime.

Annotations
@Override
hasback to summary
pack-priv boolean has(RevFlag flag)

Overrides org.eclipse.jgit.blame.Candidate.has.

Annotations
@Override
removeback to summary
pack-priv void remove(RevFlag flag)

Overrides org.eclipse.jgit.blame.Candidate.remove.

Annotations
@Override
org.eclipse.jgit.blame back to summary

pack-priv final Class Candidate.HeadCandidate

extends Candidate
Class Inheritance

A Candidate to blame a working tree file in conflict state.

Contrary to BlobCandidate, it expects to be given the parent commits (typically HEAD and the MERGE_HEADs) and behaves like a merge commit during blame. It does not consider a previously pushed Candidate as its parent.

Field Summary

Modifier and TypeField and Description
private List<RevCommit>
Inherited from org.eclipse.jgit.blame.Candidate:
queueNextregionListrenameScoresourceBlobsourceCommitsourcePathsourceText

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv PersonIdent
pack-priv RevCommit
pack-priv int
pack-priv int
pack-priv boolean
pack-priv void
Inherited from org.eclipse.jgit.blame.Candidate:
canMergeRegionscopycreategetNextCandidateloadTextmergeRegionstakeBlametoString

Field Detail

parentsback to summary
private List<RevCommit> parents

Constructor Detail

HeadCandidateback to summary
pack-priv HeadCandidate(Repository repo, PathFilter path, List<RevCommit> parents)

Method Detail

addback to summary
pack-priv void add(RevFlag flag)

Overrides org.eclipse.jgit.blame.Candidate.add.

Annotations
@Override
beginResultback to summary
pack-priv void beginResult(RevWalk rw)

Overrides org.eclipse.jgit.blame.Candidate.beginResult.

Annotations
@Override
getAuthorback to summary
pack-priv PersonIdent getAuthor()

Overrides org.eclipse.jgit.blame.Candidate.getAuthor.

Annotations
@Override
getParentback to summary
pack-priv RevCommit getParent(int idx)

Overrides org.eclipse.jgit.blame.Candidate.getParent.

Annotations
@Override
getParentCountback to summary
pack-priv int getParentCount()

Overrides org.eclipse.jgit.blame.Candidate.getParentCount.

Annotations
@Override
getTimeback to summary
pack-priv int getTime()

Overrides org.eclipse.jgit.blame.Candidate.getTime.

Annotations
@Override
hasback to summary
pack-priv boolean has(RevFlag flag)

Overrides org.eclipse.jgit.blame.Candidate.has.

Annotations
@Override
removeback to summary
pack-priv void remove(RevFlag flag)

Overrides org.eclipse.jgit.blame.Candidate.remove.

Annotations
@Override
org.eclipse.jgit.blame back to summary

pack-priv final Class Candidate.ReverseCandidate

extends Candidate
Class Inheritance

Special candidate type used for reverse blame.

Reverse blame inverts the commit history graph to follow from a commit to its descendant children, rather than the normal history direction of child to parent. These types require a ReverseCommit which keeps children pointers, allowing reverse navigation of history.

Field Summary

Inherited from org.eclipse.jgit.blame.Candidate:
queueNextregionListrenameScoresourceBlobsourceCommitsourcePathsourceText

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Candidate
pack-priv RevCommit
pack-priv int
pack-priv int
public String
toString()

Overrides org.eclipse.jgit.blame.Candidate.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jgit.blame.Candidate:
addbeginResultcanMergeRegionscopygetAuthorgetNextCandidatehasloadTextmergeRegionsremovetakeBlame

Constructor Detail

ReverseCandidateback to summary
pack-priv ReverseCandidate(Repository repo, ReverseWalk.ReverseCommit commit, PathFilter path)

Method Detail

createback to summary
pack-priv Candidate create(Repository repo, RevCommit commit, PathFilter path)

Overrides org.eclipse.jgit.blame.Candidate.create.

Annotations
@Override
getParentback to summary
pack-priv RevCommit getParent(int idx)

Overrides org.eclipse.jgit.blame.Candidate.getParent.

Annotations
@Override
getParentCountback to summary
pack-priv int getParentCount()

Overrides org.eclipse.jgit.blame.Candidate.getParentCount.

Annotations
@Override
getTimeback to summary
pack-priv int getTime()

Overrides org.eclipse.jgit.blame.Candidate.getTime.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jgit.blame.Candidate.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override