Skip to content

commits-with-notes

history

two commits annotated with git notes; first commit also carries a note in a second namespace (refs/notes/ci)

Notes are metadata attached to commits *outside* the commit object itself:
they can be added, updated, or removed without rewriting history.

Layout:
  HEAD~1 (`feat: initial widget`):
    refs/notes/commits → "Reviewed-by: Alice <alice@example.com>"
    refs/notes/ci      → "CI: passed"
  HEAD (`fix: widget alignment`):
    refs/notes/commits → "Reviewed-by: Bob <bob@example.com>\nCoverage: 92%"

The HEAD note is built with `git notes add` followed by `git notes append`,
producing a multi-line note without rewriting the first entry.

Useful for testing:
  - `git log --show-notes` display and note content parsing
  - `git notes list` output across namespaces
  - Note-aware diff and annotation tools
  - Multi-namespace enumeration (`git notes --ref=refs/notes/ci list`)
  • main is checked out
  • main has 2 commits
  • HEAD~1 has a note in refs/notes/commits containing "Reviewed-by: Alice"
  • HEAD~1 has a note in refs/notes/ci containing "CI: passed"
  • HEAD has a note in refs/notes/commits containing "Reviewed-by: Bob" and "Coverage: 92%"
notesmetadata
main
import { spinUpScenario } from '@gfargo/git-scenarios'

const repo = await spinUpScenario('commits-with-notes')
* c8df691 (HEAD -> main) fix: widget alignment
* f42f25b feat: initial widget
* 465151c Notes added by 'git notes append'
* fbc9631 Notes added by 'git notes add'
* 3ce2336 Notes added by 'git notes add'
* 552cc08 Notes added by 'git notes add'

Back to Scenario Browser