Interface Commits
-
Method Summary
Modifier and TypeMethodDescription<C extends BaseCommitObj>
Iterator<C> commitLog(String refName, OptionalLong offsetCommitId, Class<C> clazz) Retrieves the commit log in the natural, chronologically reverse order - most recent commit first.<C extends BaseCommitObj>
Iterator<C> commitLogReversed(String refName, long offsetCommitId, Class<C> clazz) Retrieves the commit log in chronological order starting after the given offset commit ID.
-
Method Details
-
commitLog
<C extends BaseCommitObj> Iterator<C> commitLog(String refName, OptionalLong offsetCommitId, Class<C> clazz) Retrieves the commit log in the natural, chronologically reverse order - most recent commit first.If
offsetCommitIdis empty, iteration starts at the current head ofrefName.If
offsetCommitIdis present, the returned iterator is inclusive of that commit ID. Resolving the offset commit ID intentionally performs a linear walk from the current head toward older commits until the commit ID is encountered or visible history ends. This lookup is not internally bounded.If the offset commit ID is not encountered while walking the visible history, the implementation attempts to resume directly from the commit object identified by that ID. If that commit object is not available either, iteration resumes from the oldest still-visible commit reached by the scan, if any.
- Parameters:
offsetCommitId- optional commit ID to resume from; not a sequential position in the commit log
-
commitLogReversed
<C extends BaseCommitObj> Iterator<C> commitLogReversed(String refName, long offsetCommitId, Class<C> clazz) Retrieves the commit log in chronological order starting after the given offset commit ID.The supplied
offsetCommitIdis exclusive. Resolving the offset commit ID intentionally performs a linear walk from the current head toward older commits until the commit ID is encountered or visible history ends. This lookup is not internally bounded.If the offset commit ID is not encountered in the visible history, the full visible history is returned in chronological order.
This function is useful when retrieving commits to serve events/notification use cases.
- Parameters:
offsetCommitId- commit ID to resume after; not a sequential position in the commit log
-