If a user downgrades or disables the core.commitGraph config
setting, then the existing object database is sufficient.
It stores the commit graph structure along with some extra metadata to speed up graph walks. By listing commit OIDs in lexicographic order, we can identify an integer position for each commit and refer to the parents of a commit using those integer positions. We use binary search to find initial commits and then use the integer positions for fast lookups during the walk.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | CommitGraph.
Metadata of a commit in commit data chunk. |
| Modifier and Type | Field and Description |
|---|---|
| public static final CommitGraph | EMPTY
Empty |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the commit-graph position or -1 if the object was not found.the commit for which the commit-graph position will be found. commit)Find the position in the commit-graph of the commit. |
| public ChangedPathFilter | Returns: the bloom filter or null if it's not found.the position in the commit-graph of the object. graphPos)Get the changed path filter of the object at the commit-graph position. |
| public long | Returns: number of commits in this commit-graph.Obtain the total number of commits described by this commit-graph. |
| public CommitGraph. | Returns: the metadata of a commit or null if it's not found.the position in the commit-graph of the object. graphPos)Get the metadata of a commit。 This function runs in time O(1). |
| public ObjectId | Returns: the ObjectId or null if it's not found.the position in the commit-graph of the object. graphPos)Get the object at the commit-graph position. |
| EMPTY | back to summary |
|---|---|
| public static final CommitGraph EMPTY Empty | |
| findGraphPosition | back to summary |
|---|---|
| public int findGraphPosition(AnyObjectId commit) Find the position in the commit-graph of the commit. The position can only be used within the CommitGraph Instance you got it from. That's because the graph position of the same commit may be different in CommitGraph obtained at different times (eg., regenerated new commit-graph).
| |
| getChangedPathFilter | back to summary |
|---|---|
| public ChangedPathFilter getChangedPathFilter(int graphPos) Get the changed path filter of the object at the commit-graph position.
| |
| getCommitCnt | back to summary |
|---|---|
| public long getCommitCnt() Obtain the total number of commits described by this commit-graph.
| |
| getCommitData | back to summary |
|---|---|
| public CommitGraph. Get the metadata of a commit。 This function runs in time O(1).
In the process of commit history traversal,
| |
| getObjectId | back to summary |
|---|---|
| public ObjectId getObjectId(int graphPos) Get the object at the commit-graph position.
| |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public int | Returns: the generation number ororg.
if the writer didn't calculate it.Get the generation number (the distance from the root) of the commit. |
| public int[] | |
| public ObjectId |
| getCommitTime | back to summary |
|---|---|
| public long getCommitTime() Time from the "committer" line.
| |
| getGeneration | back to summary |
|---|---|
| public int getGeneration() Get the generation number (the distance from the root) of the commit.
| |
| getParents | back to summary |
|---|---|
| public int[] getParents() Obtain an array of all parents.
The method only provides the graph positions of parents in
commit-graph, call
| |
| getTree | back to summary |
|---|---|
| public ObjectId getTree() Get a reference to this commit's tree.
| |