Skip to content

gix notes - #2930

Draft
Sebastian Thiel (Byron) wants to merge 9 commits into
mainfrom
gix-notes
Draft

gix notes#2930
Sebastian Thiel (Byron) wants to merge 9 commits into
mainfrom
gix-notes

Conversation

@Byron

Copy link
Copy Markdown
Member

Tasks

  • refackiew

@Byron
Sebastian Thiel (Byron) force-pushed the gix-notes branch 2 times, most recently from 81bec68 to 78c14d7 Compare August 20, 2026 14:10
Even though in the good case, there will be more time spent, the first
pass will catch most mistakes which then would cause an expensive re-run.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
This makes it easier to see what failed.

Assisted-by: GPT 5.6
Add `CorruptionError`, `NotFoundError`, and the source-preserving `RetryableError` marker, with constructors and message conversions for the concrete classification errors. Expose `Error::{can_retry,is_corrupted,is_not_found,is_validation}` plus a free `can_retry()` helper for classifying arbitrary standard errors.

Inspect complete source chains and recursively enter nested `gix_error::Error` values instead of relying on message text. Treat explicit retry markers and interrupted, unexpected-EOF, out-of-memory, timeout, broken-pipe, address-in-use, connection-aborted, connection-reset, and connection-refused I/O failures as retryable. Recognize missing resources through `NotFoundError` and `io::ErrorKind::NotFound`, while corruption and validation remain explicit typed classifications.

Add `Error::from_boxed()` so boxed `Send + Sync` standard errors can enter gix-error without losing their source chain.

Retain nested gix errors as typed values when converting or raising them instead of copying their sources into string-only frames. Preserve the remainder of copied standard source chains, recursively reveal erased `Untyped` payloads for downcasting, and render retained nested sources when formatting raised errors.

Make `Error::sources()` expand nested gix errors and expose stored payload types in auto-chain mode. Recurse through nested errors when selecting `probable_cause()`, mark the selected frame while flattening error trees, and let the final chained node fall back to the wrapped error source so source traversal and probable-cause identity survive conversion.

Keep classification and cause discovery consistent between tree-error mode and the flattened auto-chain-error representation. Extend both test suites to cover every classification, boxed conversion, nested conversions, typed-source retention, copied source chains, and probable causes after flattening, and update the crate documentation for the new categories and retention behavior.
<!-- agent -->
Establish the minimal plumbing API needed to query notes efficiently for many
objects, such as every commit visible in a history view.

Resolve note blobs through Git notes progressive two-hex-digit fanout trees
and use Git tree ordering for direct entry lookup. Load only trees along the
requested object path and retain decoded trees in a caller-owned cache that can
be reused across lookups and notes roots.

Ignore entries that do not form valid notes instead of mistaking arbitrary tree
contents for mappings. Use gix-error for contextual failures.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
<!-- agent -->
Add plumbing operations to insert, replace, and remove note mappings while
returning the rewritten root tree and the previous note id.

Rebuild notes using the same dynamic fanout rule as Git so growing and shrinking
collections remain compatible with existing notes trees. Preserve unrelated
entries during rewriting, reject mixed object-hash kinds, report duplicate
mappings, and leave the tree unchanged when removing a missing note.

Keep object persistence delegated through Find and Write traits, allowing
callers to decide how commits and refs are updated.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
<!-- agent -->
Add the notes feature and `Repository::notes` as the porcelain layer over `gix-note`
for repeated queries and mutations.

Select the default notes ref from `core.notesRef`, including the `GIT_NOTES_REF`
environment override represented in `config::tree`, and fall back to
`refs/notes/commits`. Discover additional display refs from `notes.displayRef` or
`GIT_NOTES_DISPLAY_REF`, expand glob patterns, preserve display order, and avoid
duplicates.

For mutations, accept conventional short notes-ref names, write note blobs and
notes commits, and update refs with compare-and-swap expectations so concurrent
changes are not silently overwritten.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant