module documentation

Git notes handling.

Class Notes High-level interface for Git notes operations.
Class NotesTree Represents a Git notes tree.
Function create_notes_tree Create an empty notes tree.
Function get_note_fanout_level Determine the fanout level for a note tree.
Function get_note_path Get the path within the notes tree for a given object.
Function split_path_for_fanout Split a hex SHA into path components based on fanout level.
Constant DEFAULT_NOTES_REF Undocumented
Constant NOTES_REF_PREFIX Undocumented
def create_notes_tree(object_store: BaseObjectStore) -> Tree:

Create an empty notes tree.

Parameters
object_store:BaseObjectStoreObject store to add the tree to
Returns
TreeEmpty tree object
def get_note_fanout_level(tree: Tree, object_store: BaseObjectStore) -> int:

Determine the fanout level for a note tree.

Git uses a fanout directory structure for performance with large numbers of notes. The fanout level determines how many levels of subdirectories are used.

Parameters
tree:TreeThe notes tree to analyze
object_store:BaseObjectStoreObject store to retrieve subtrees
Returns
intFanout level (0 for no fanout, 1 or 2 for fanout)
def get_note_path(object_sha: bytes, fanout_level: int = 0) -> bytes:

Get the path within the notes tree for a given object.

Parameters
object_sha:bytesHex SHA of the object to get notes for
fanout_level:intFanout level to use
Returns
bytesPath within the notes tree
def split_path_for_fanout(hexsha: bytes, fanout_level: int) -> tuple[bytes, ...]:

Split a hex SHA into path components based on fanout level.

Parameters
hexsha:bytesHex SHA of the object
fanout_level:intNumber of directory levels for fanout
Returns
tuple[bytes, ...]Tuple of path components
DEFAULT_NOTES_REF =

Undocumented

Value
NOTES_REF_PREFIX + b'commits'
NOTES_REF_PREFIX: bytes =

Undocumented

Value
b'refs/notes/'