class documentation
High-level interface for Git notes operations.
| Method | __init__ |
Initialize Notes. |
| Method | get |
Get the note for an object. |
| Method | get |
Get the notes reference to use. |
| Method | list |
List all notes in a notes ref. |
| Method | remove |
Remove a note for an object. |
| Method | set |
Set or update a note for an object. |
| Instance Variable | _object |
Undocumented |
| Instance Variable | _refs |
Undocumented |
Initialize Notes.
| Parameters | |
objectBaseObjectStore | Object store to read/write objects |
refsRefsContainer | Refs container to read/write refs |
def get_notes_ref(self, notes_ref:
bytes | None = None, config: StackedConfig | None = None) -> Ref:
¶
Get the notes reference to use.
| Parameters | |
notesbytes | None | The notes ref to use, or None to use the default |
config:StackedConfig | None | Config to read notes.displayRef from |
| Returns | |
Ref | The notes reference name |
def remove_note(self, object_sha:
bytes, notes_ref: bytes | None = None, author: bytes | None = None, committer: bytes | None = None, message: bytes | None = None, config: StackedConfig | None = None) -> bytes | None:
¶
Remove a note for an object.
| Parameters | |
objectbytes | SHA of the object to remove notes from |
notesbytes | None | The notes ref to use, or None to use the default |
author:bytes | None | Author identity (defaults to committer) |
committer:bytes | None | Committer identity (defaults to config) |
message:bytes | None | Commit message for the notes removal |
config:StackedConfig | None | Config to read user identity and notes.displayRef from |
| Returns | |
bytes | None | SHA of the new notes commit, or None if no note existed |
def set_note(self, object_sha:
bytes, note_content: bytes, notes_ref: bytes | None = None, author: bytes | None = None, committer: bytes | None = None, message: bytes | None = None, config: StackedConfig | None = None) -> bytes:
¶
Set or update a note for an object.
| Parameters | |
objectbytes | SHA of the object to annotate |
notebytes | Content of the note |
notesbytes | None | The notes ref to use, or None to use the default |
author:bytes | None | Author identity (defaults to committer) |
committer:bytes | None | Committer identity (defaults to config) |
message:bytes | None | Commit message for the notes update |
config:StackedConfig | None | Config to read user identity and notes.displayRef from |
| Returns | |
bytes | SHA of the new notes commit |