Expand description
git notes tree manipulation — the fanout tree mapping object -> note blob.
Notes are stored as blobs in a tree referenced by refs/notes/commits (or a
custom namespace via --ref). Each leaf in the notes tree is named by the
full hex SHA of the annotated object, optionally split into a fanout layout
(ab/cd/ef…) once the note count grows large.
This module owns the pure tree operations over the object database: reading
the notes tree into a flat entry list, computing the fanout layout, writing a
new notes tree + commit, combining note blobs (concatenate / cat_sort_uniq),
and the notes-merge data model (pairing local/remote/base changes and applying
a merge strategy). The grit binary keeps argument parsing, editor launch,
stdin reading, output, and exit-code mapping.
Structs§
Enums§
Constants§
- NOTES_
MERGE_ WORKTREE - Per-worktree subdirectory holding the conflicted note blobs during a notes merge.
Functions§
- combine_
notes_ cat_ sort_ uniq - Matches Git’s
combine_notes_cat_sort_uniq: all lines from both blobs, de-duplicated and sorted. - combine_
notes_ concatenate - Matches Git’s
combine_notes_concatenate: join two note blobs with a blank line between them. - display_
note_ path - expand_
notes_ ref - Match Git’s
expand_notes_ref(notes.c): only--refuses this; env/config refs are verbatim. - note_
object_ name - notes_
merge_ git_ dir - Per-worktree git directory for
NOTES_MERGE_*(main:.git/, linked:.git/worktrees/<id>/). - notes_
merge_ inner - notes_
merge_ worktree_ nonempty - True when
NOTES_MERGE_WORKTREEexists and is not empty (matches Gitis_empty_dir). - notes_
merge_ worktree_ path - parse_
notes_ merge_ strategy_ value - read_
notes_ tree - Read the notes tree entries from the notes ref. Returns an empty vec if the ref doesn’t exist yet.
- upsert_
note_ entry - write_
notes_ commit - Write a new notes tree and commit, updating the notes ref.
- write_
notes_ commit_ with_ parents