Top Description Inners Methods
org.eclipse.jgit.revwalk

public Interface DepthWalk

Known Direct Implementers
org.eclipse.jgit.revwalk.DepthWalk.RevWalk, org.eclipse.jgit.revwalk.DepthWalk.ObjectWalk
Imports
java.io.IOException, java.util.Collections, .List, .Objects, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException, org.eclipse.jgit.lib.AnyObjectId, .ObjectId, .ObjectReader, .Repository

Interface for revision walkers that perform depth filtering.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
DepthWalk.Commit

RevCommit with a depth (in commits) from a root.

public static class
DepthWalk.ObjectWalk

Subclass of ObjectWalk that performs depth filtering.

public static class
DepthWalk.RevWalk

Subclass of RevWalk that performs depth filtering.

Method Summary

Modifier and TypeMethod and Description
public RevFlag

Returns:

flag marking commits that are to be excluded because of --shallow-exclude
getDeepenNotFlag
()

Get deepen-not flag

public default List<ObjectId>

Returns:

the objects specified by the client using --shallow-exclude
getDeepenNots
()

Get deepen-not values

public default int

Returns:

the deepen-since value; if not 0, this walk only returns commits whose commit time is at or after this limit
getDeepenSince
()

Get deepen-since value

public int

Returns:

Depth to filter to.
getDepth
()

Get depth to filter to.

public RevFlag

Returns:

flag marking commits that are interesting again.
getReinterestingFlag
()

Get flag marking commits that are interesting again.

public RevFlag

Returns:

flag marking commits that should become unshallow.
getUnshallowFlag
()

Get flag marking commits that should become unshallow.

Method Detail

getDeepenNotFlagback to summary
public RevFlag getDeepenNotFlag()

Get deepen-not flag

Returns:RevFlag

flag marking commits that are to be excluded because of --shallow-exclude

Since
5.2
getDeepenNotsback to summary
public default List<ObjectId> getDeepenNots()

Get deepen-not values

Returns:List<ObjectId>

the objects specified by the client using --shallow-exclude

Since
5.2
getDeepenSinceback to summary
public default int getDeepenSince()

Get deepen-since value

Returns:int

the deepen-since value; if not 0, this walk only returns commits whose commit time is at or after this limit

Since
5.2
getDepthback to summary
public int getDepth()

Get depth to filter to.

Returns:int

Depth to filter to.

getReinterestingFlagback to summary
public RevFlag getReinterestingFlag()

Get flag marking commits that are interesting again.

Returns:RevFlag

flag marking commits that are interesting again.

getUnshallowFlagback to summary
public RevFlag getUnshallowFlag()

Get flag marking commits that should become unshallow.

Returns:RevFlag

flag marking commits that should become unshallow.

org.eclipse.jgit.revwalk back to summary

public Class DepthWalk.Commit

extends RevCommit
Class Inheritance

RevCommit with a depth (in commits) from a root.

Field Summary

Modifier and TypeField and Description
pack-priv int
depth

Depth of this commit in the graph, via shortest path.

pack-priv boolean
pack-priv boolean
makesChildBoundary

True if this commit was excluded due to a shallow fetch setting.

Inherited from org.eclipse.jgit.revwalk.RevCommit:
buffercommitTimeinDegreeNO_PARENTSparentstree

Constructor Summary

AccessConstructor and Description
protected
Commit(AnyObjectId
object name for the commit.
id
)

Initialize a new commit.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

depth of this commit, as found by the shortest path.
getDepth
()

Get depth

public boolean

Returns:

true if at least one of this commit's parents was excluded due to a shallow fetch setting, false otherwise
isBoundary
()

Whether at least one commit was excluded due to shallow fetch

Inherited from org.eclipse.jgit.revwalk.RevCommit:
carrycarryFlagsdisposeBodygetAuthorIdentgetChangedPathFiltergetCommitterIdentgetCommitTimegetEncodinggetEncodingNamegetFirstMessageLinegetFooterLinesgetFooterLinesgetFooterLinesgetFullMessagegetGenerationgetParentgetParentCountgetParentsgetRawBuffergetRawGpgSignaturegetShortMessagegetTreegetTypehasLFparseparseparseBodyparseCanonicalparseHeadersresettoString

Field Detail

depthback to summary
pack-priv int depth

Depth of this commit in the graph, via shortest path.

isBoundaryback to summary
pack-priv boolean isBoundary
makesChildBoundaryback to summary
pack-priv boolean makesChildBoundary

True if this commit was excluded due to a shallow fetch setting. All its children are thus boundary commits.

Constructor Detail

Commitback to summary
protected Commit(AnyObjectId id)

Initialize a new commit.

Parameters
id:AnyObjectId

object name for the commit.

Method Detail

getDepthback to summary
public int getDepth()

Get depth

Returns:int

depth of this commit, as found by the shortest path.

isBoundaryback to summary
public boolean isBoundary()

Whether at least one commit was excluded due to shallow fetch

Returns:boolean

true if at least one of this commit's parents was excluded due to a shallow fetch setting, false otherwise

Since
5.2
org.eclipse.jgit.revwalk back to summary

public Class DepthWalk.ObjectWalk

extends ObjectWalk
implements DepthWalk
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.revwalk.DepthWalk

Subclass of ObjectWalk that performs depth filtering.

Field Summary

Modifier and TypeField and Description
private final RevFlag
private List<ObjectId>
private int
private final int
private final RevFlag
private final RevFlag
Inherited from org.eclipse.jgit.revwalk.ObjectWalk:
SIMPLE_VISITATION_POLICY

Constructor Summary

AccessConstructor and Description
public
ObjectWalk(Repository
Repository to walk
repo
,
int
Maximum depth to return
depth
)

Create ObjectWalk

public
ObjectWalk(ObjectReader
Object Reader
or
,
int
Maximum depth to return
depth
)

Create ObjectWalk

Method Summary

Modifier and TypeMethod and Description
protected RevCommit
createCommit(AnyObjectId
the object this walker requires a commit reference for.
id
)

Overrides org.eclipse.jgit.revwalk.RevWalk.createCommit.

Construct a new unparsed commit for the given object.

public RevFlag
public List<ObjectId>
getDeepenNots()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenNots.

Get deepen-not values

public int
getDeepenSince()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenSince.

Get deepen-since value

public int
getDepth()

Implements org.eclipse.jgit.revwalk.DepthWalk.getDepth.

Get depth to filter to.

public RevFlag
getReinterestingFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getReinterestingFlag.

Get flag marking commits that are interesting again.

public RevFlag
getUnshallowFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getUnshallowFlag.

Get flag marking commits that should become unshallow.

public void
markRoot(RevObject
Commit to mark
o
)

Mark a root commit (i.e., one whose depth should be considered 0.)

public void
markUnshallow(RevObject
Commit to mark
c
)

Mark an element which used to be shallow in the client, but which should now be considered a full commit.

Inherited from org.eclipse.jgit.revwalk.ObjectWalk:
checkConnectivitydisposegetObjectFiltergetPathBuffergetPathHashCodegetPathLengthgetPathStringgetTreeDepthmarkStartmarkUninterestingnextnextObjectresetsetObjectFiltersetVisitationPolicyskipTreesortsort

Field Detail

DEEPEN_NOTback to summary
private final RevFlag DEEPEN_NOT
deepenNotsback to summary
private List<ObjectId> deepenNots
deepenSinceback to summary
private int deepenSince
depthback to summary
private final int depth
REINTERESTINGback to summary
private final RevFlag REINTERESTING
UNSHALLOWback to summary
private final RevFlag UNSHALLOW

Constructor Detail

ObjectWalkback to summary
public ObjectWalk(Repository repo, int depth)

Create ObjectWalk

Parameters
repo:Repository

Repository to walk

depth:int

Maximum depth to return

ObjectWalkback to summary
public ObjectWalk(ObjectReader or, int depth)

Create ObjectWalk

Parameters
or:ObjectReader

Object Reader

depth:int

Maximum depth to return

Method Detail

createCommitback to summary
protected RevCommit createCommit(AnyObjectId id)

Overrides org.eclipse.jgit.revwalk.RevWalk.createCommit.

Doc from org.eclipse.jgit.revwalk.RevWalk.createCommit.

Construct a new unparsed commit for the given object.

Parameters
id:AnyObjectId

the object this walker requires a commit reference for.

Returns:RevCommit

a new unparsed reference for the object.

Annotations
@Override
getDeepenNotFlagback to summary
public RevFlag getDeepenNotFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getDeepenNotFlag.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDeepenNotFlag.

Get deepen-not flag

Returns:RevFlag

flag marking commits that are to be excluded because of --shallow-exclude

Annotations
@Override
getDeepenNotsback to summary
public List<ObjectId> getDeepenNots()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenNots.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDeepenNots.

Get deepen-not values

Returns:List<ObjectId>

the objects specified by the client using --shallow-exclude

Annotations
@Override
getDeepenSinceback to summary
public int getDeepenSince()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenSince.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDeepenSince.

Get deepen-since value

Returns:int

the deepen-since value; if not 0, this walk only returns commits whose commit time is at or after this limit

Annotations
@Override
getDepthback to summary
public int getDepth()

Implements org.eclipse.jgit.revwalk.DepthWalk.getDepth.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDepth.

Get depth to filter to.

Returns:int

Depth to filter to.

Annotations
@Override
getReinterestingFlagback to summary
public RevFlag getReinterestingFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getReinterestingFlag.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getReinterestingFlag.

Get flag marking commits that are interesting again.

Returns:RevFlag

flag marking commits that are interesting again.

Annotations
@Override
getUnshallowFlagback to summary
public RevFlag getUnshallowFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getUnshallowFlag.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getUnshallowFlag.

Get flag marking commits that should become unshallow.

Returns:RevFlag

flag marking commits that should become unshallow.

Annotations
@Override
markRootback to summary
public void markRoot(RevObject o) throws MissingObjectException, IncorrectObjectTypeException, IOException

Mark a root commit (i.e., one whose depth should be considered 0.)

Parameters
o:RevObject

Commit to mark

Exceptions
MissingObjectException:
if object is missing
IncorrectObjectTypeException:
if object has an unexpected type
IOException:
if an IO error occurred
markUnshallowback to summary
public void markUnshallow(RevObject c) throws MissingObjectException, IncorrectObjectTypeException, IOException

Mark an element which used to be shallow in the client, but which should now be considered a full commit. Any ancestors of this commit should be included in the walk, even if they are the ancestor of an uninteresting commit.

Parameters
c:RevObject

Commit to mark

Exceptions
MissingObjectException:
if object is missing
IncorrectObjectTypeException:
if object has an unexpected type
IOException:
if an IO error occurred
org.eclipse.jgit.revwalk back to summary

public Class DepthWalk.RevWalk

extends RevWalk
implements DepthWalk
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.revwalk.DepthWalk

Subclass of RevWalk that performs depth filtering.

Field Summary

Modifier and TypeField and Description
private final RevFlag
private List<ObjectId>
private int
private final int
private final RevFlag
private final RevFlag
Inherited from org.eclipse.jgit.revwalk.RevWalk:
carryFlagsfreeFlagsidBufferobjectsPARSEDpendingqueuereaderRESERVED_FLAGSREWRITErootsSEENshallowCommitsInitializedTEMP_MARKTOPO_DELAYTOPO_QUEUEDTREE_REV_FILTER_APPLIEDUNINTERESTING

Constructor Summary

AccessConstructor and Description
public
RevWalk(Repository
Repository to walk
repo
,
int
Maximum depth to return
depth
)

Create RevWalk

public
RevWalk(ObjectReader
ObjectReader to use
or
,
int
Maximum depth to return
depth
)

Create RevWalk

Method Summary

Modifier and TypeMethod and Description
protected RevCommit
createCommit(AnyObjectId
the object this walker requires a commit reference for.
id
)

Overrides org.eclipse.jgit.revwalk.RevWalk.createCommit.

Construct a new unparsed commit for the given object.

public RevFlag
public List<ObjectId>
getDeepenNots()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenNots.

Get deepen-not values

public int
getDeepenSince()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenSince.

Get deepen-since value

public int
getDepth()

Implements org.eclipse.jgit.revwalk.DepthWalk.getDepth.

Get depth to filter to.

public RevFlag
getReinterestingFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getReinterestingFlag.

Get flag marking commits that are interesting again.

public RevFlag
getUnshallowFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getUnshallowFlag.

Get flag marking commits that should become unshallow.

public void
markRoot(RevCommit
Commit to mark
c
)

Mark a root commit (i.e., one whose depth should be considered 0.)

public void
setDeepenNots(List<ObjectId>
specified objects
deepenNots
)

Mark objects that the client specified using --shallow-exclude.

public void
setDeepenSince(int
new deepen-since value
limit
)

Sets the deepen-since value.

public DepthWalk.ObjectWalk
Inherited from org.eclipse.jgit.revwalk.RevWalk:
allocFlagassertNoCommitsMarkedStartassertNotStartedassumeShallowcarrycarrycarryFlagsImplclosecommitGraphdisposedisposeFlagfreeFlaggetCachedBytesgetCachedBytesgetMergedIntogetMergedIntogetObjectReadergetRevFiltergetRevSortgetRewriteParentsgetTreeFilterhasRevSortinitializeShallowCommitsisFirstParentisMergedIntoisMergedIntoAllisMergedIntoAnyisMergedIntoAnyCommitisRetainBodyiteratorlookupAnylookupBloblookupCommitlookupCommitlookupOrNulllookupTaglookupTreemarkStartmarkStartmarkUninterestingnewDateRevQueuenewDateRevQueuenewFlagnextparseAnyparseAnyparseBodyparseCommitparseHeadersparseTagparseTreepeelresetresetresetRetainresetRetainretainOnResetretainOnResetsetFirstParentsetRetainBodysetRevFiltersetRewriteParentssetTreeFiltersortsort

Field Detail

DEEPEN_NOTback to summary
private final RevFlag DEEPEN_NOT
deepenNotsback to summary
private List<ObjectId> deepenNots
deepenSinceback to summary
private int deepenSince
depthback to summary
private final int depth
REINTERESTINGback to summary
private final RevFlag REINTERESTING
UNSHALLOWback to summary
private final RevFlag UNSHALLOW

Constructor Detail

RevWalkback to summary
public RevWalk(Repository repo, int depth)

Create RevWalk

Parameters
repo:Repository

Repository to walk

depth:int

Maximum depth to return

RevWalkback to summary
public RevWalk(ObjectReader or, int depth)

Create RevWalk

Parameters
or:ObjectReader

ObjectReader to use

depth:int

Maximum depth to return

Method Detail

createCommitback to summary
protected RevCommit createCommit(AnyObjectId id)

Overrides org.eclipse.jgit.revwalk.RevWalk.createCommit.

Doc from org.eclipse.jgit.revwalk.RevWalk.createCommit.

Construct a new unparsed commit for the given object.

Parameters
id:AnyObjectId

the object this walker requires a commit reference for.

Returns:RevCommit

a new unparsed reference for the object.

Annotations
@Override
getDeepenNotFlagback to summary
public RevFlag getDeepenNotFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getDeepenNotFlag.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDeepenNotFlag.

Get deepen-not flag

Returns:RevFlag

flag marking commits that are to be excluded because of --shallow-exclude

Annotations
@Override
getDeepenNotsback to summary
public List<ObjectId> getDeepenNots()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenNots.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDeepenNots.

Get deepen-not values

Returns:List<ObjectId>

the objects specified by the client using --shallow-exclude

Annotations
@Override
getDeepenSinceback to summary
public int getDeepenSince()

Overrides default org.eclipse.jgit.revwalk.DepthWalk.getDeepenSince.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDeepenSince.

Get deepen-since value

Returns:int

the deepen-since value; if not 0, this walk only returns commits whose commit time is at or after this limit

Annotations
@Override
getDepthback to summary
public int getDepth()

Implements org.eclipse.jgit.revwalk.DepthWalk.getDepth.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getDepth.

Get depth to filter to.

Returns:int

Depth to filter to.

Annotations
@Override
getReinterestingFlagback to summary
public RevFlag getReinterestingFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getReinterestingFlag.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getReinterestingFlag.

Get flag marking commits that are interesting again.

Returns:RevFlag

flag marking commits that are interesting again.

Annotations
@Override
getUnshallowFlagback to summary
public RevFlag getUnshallowFlag()

Implements org.eclipse.jgit.revwalk.DepthWalk.getUnshallowFlag.

Doc from org.eclipse.jgit.revwalk.DepthWalk.getUnshallowFlag.

Get flag marking commits that should become unshallow.

Returns:RevFlag

flag marking commits that should become unshallow.

Annotations
@Override
markRootback to summary
public void markRoot(RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException

Mark a root commit (i.e., one whose depth should be considered 0.)

Parameters
c:RevCommit

Commit to mark

Exceptions
MissingObjectException:
if object is missing
IncorrectObjectTypeException:
if object has an unexpected type
IOException:
if an IO error occurred
setDeepenNotsback to summary
public void setDeepenNots(List<ObjectId> deepenNots)

Mark objects that the client specified using --shallow-exclude. Objects that are not commits have no effect.

Parameters
deepenNots:List<ObjectId>

specified objects

Since
5.2
setDeepenSinceback to summary
public void setDeepenSince(int limit)

Sets the deepen-since value.

Parameters
limit:int

new deepen-since value

Since
5.2
toObjectWalkWithSameObjectsback to summary
public DepthWalk.ObjectWalk toObjectWalkWithSameObjects()

Overrides org.eclipse.jgit.revwalk.RevWalk.toObjectWalkWithSameObjects.

Convert to ObjectWalk with same objects

Returns:DepthWalk.ObjectWalk

Doc from org.eclipse.jgit.revwalk.RevWalk.toObjectWalkWithSameObjects.

a new walk, using the exact same object pool.

Annotations
@Override
Since
4.5