git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: GC can lose objects pointed to only by notes?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2021, 20:20 UTC
Message-ID
<xmqq35y33c9u.fsf@gitster.c.googlers.com>
In-Reply-To
<CANiSa6h=S6tHUR4hY85uZ7ZcnDc2mdUzPwyBDakQAa_NP+O0YA@mail.gmail.com>
Martin von Zweigbergk <martinvonz@gmail.com> writes:
Show 6 quoted lines
> From the "NOTES" section in `git help gc`:
> "[...] it will keep [..] objects referenced by the index,
> remote-tracking branches, notes saved by git notes under refs/notes/"
>
> I had interpreted that as saying that it will keep objects pointed to
> by notes saved under refs/notes.
The documentation needs updating.

There is no reachability from the notes that point at an otherwise uninteresting objects that are not pointed at by real refs, so a note that talks about a commit that is pruned will become stale.

It is the reason why we need the "git notes prune" subcommand.
Thanks.
Previous: Martin von Zweigbergk
Message 2 of 2 in “GC can lose objects pointed to only by notes?”
  1. Martin von ZweigbergkFeb 10, 2021
  2. Junio C HamanoFeb 10, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.