Skip to content

Handle all Git notes fanout depths#1908

Open
svarlamov wants to merge 1 commit into
mainfrom
fix/1517-1784396921
Open

Handle all Git notes fanout depths#1908
svarlamov wants to merge 1 commit into
mainfrom
fix/1517-1784396921

Conversation

@svarlamov

@svarlamov svarlamov commented Jul 18, 2026

Copy link
Copy Markdown
Member

Fixes #1517

Summary

  • enumerate every valid two-hex Git notes fanout depth instead of hard-coding flat and one-directory paths
  • normalize returned note paths in place and keep one borrowed lookup entry per requested commit, avoiding 20 SHA-1 or 32 SHA-256 path entries per commit
  • remove every historical path in both batched note writers before writing the canonical path
  • emit cleanup commands directly into the fast-import buffer without allocating a temporary String for every fanout depth
  • preserve deterministic flat/canonical/deeper read precedence

Test coverage

  • reproduces duplicate-note JSON deserialization failure across flat, three-component, and maximally deep fanout paths
  • verifies both content-backed and blob-backed batch writers remove every legacy copy
  • verifies batch reads find deeply fanned-out historical notes
  • verifies in-place path normalization and allocation-free deletion command generation
  • task test
  • task lint
  • task fmt

Open in Devin Review

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@svarlamov
svarlamov force-pushed the fix/1517-1784396921 branch from d1ddb78 to b747f60 Compare July 21, 2026 03:23
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.

Bug: notes_add_batch fails to delete 3-level fanout paths, causing duplicate notes and stats deserialization failure

1 participant