Struct branchless::core::graph::Node [−][src]
pub struct Node<'repo> { pub commit: Commit<'repo>, pub parent: Option<Oid>, pub children: Vec<Oid>, pub is_main: bool, pub is_visible: bool, pub event: Option<Event>, }
Expand description
Node contained in the smartlog commit graph.
Fields
commit: Commit<'repo>
The underlying commit object.
parent: Option<Oid>
The OID of the parent node in the smartlog commit graph.
This is different from inspecting commit.parents()
, since the smartlog
will hide most nodes from the commit graph, including parent nodes.
children: Vec<Oid>
The OIDs of the children nodes in the smartlog commit graph.
is_main: bool
Indicates that this is a commit to the main branch.
These commits are considered to be immutable and should never leave the
main
state. However, this can still happen sometimes if the user’s
workflow is different than expected.
is_visible: bool
Indicates that this commit should be considered “visible”.
A visible commit is a commit that hasn’t been checked into the main branch, but the user is actively working on. We may infer this from user behavior, e.g. they committed something recently, so they are now working on it.
In contrast, a hidden commit is a commit that hasn’t been checked into the main branch, and the user is no longer working on. We may infer this from user behavior, e.g. they have rebased a commit and no longer want to see the old version of that commit. The user can also manually hide commits.
Occasionally, a main commit can be marked as hidden, such as if a commit in the main branch has been rewritten. We don’t expect this to happen in the monorepo workflow, but it can happen in other workflows where you commit directly to the main branch and then later rewrite the commit.
event: Option<Event>
The latest event to affect this commit.
It’s possible that no event affected this commit, and it was simply
visible due to a reference pointing to it. In that case, this field is
None
.
Trait Implementations
Auto Trait Implementations
impl<'repo> RefUnwindSafe for Node<'repo>
impl<'repo> UnwindSafe for Node<'repo>