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

Re: [PATCH] docs: clarify that refs/notes/ do not keep the attached objects alive

From
Martin von Zweigbergk <martinvonz@google.com>
Date
Feb 11, 2021, 07:14 UTC
Message-ID
<CAESOdVDgpe9yacMxKLO_AjAnadcSjrik_NdwhW-4vDELf+UxPw@mail.gmail.com>
In-Reply-To
<xmqqo8grzbjv.fsf@gitster.c.googlers.com>
On Wed, Feb 10, 2021 at 2:35 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
>
> Martin von Zweigbergk <martinvonz@google.com> writes:
>
> >  ... In particular, it will keep not only
> > +objects referenced by the index, remote-tracking branches, reflogs
> > +(which may reference commits in branches that were later amended or
> > +rewound), and anything else in the refs/* namespace. Notes saved by
> > +'git notes' under refs/notes/ will be kept, but the objects (typically
> > +commits) they are attached to will not be.
>
> The notes will not contribute in keeping the objects they are
> attached to.  As long as the objects have some paths from refs and
> reflog entries (reachability anchors), they will be kept.  These
> two are facts.
>
> But I am afraid that the new phrasing can be misread as saying that
> an object, if it has notes attached to it, will not be kept, period.
>
> Knowing Git, we can tell immediately that it would be a nonsense
> behaviour, but still, I think that is how it can be read, so I
> suspect that the new text would invite a misunderstanding in the
> opposite direction.
>
>     ... and anything else in the refs/* namespace.  Note that a note
>     attached to an object does not contribute in keeping the object
>     alive.
>
> would be less misinterpretation-inducing, perhaps.

Good point. You dropped the bit about the notes (texts) being kept alive. I don't know if you did that intentionally are not. I initially thought that we should keep that bit, but it's probably not actually very useful information. Users probably don't have large amounts of information stored in notes, so they probably don't care whether notes text is kept, especially since there's no good way of pruning the notes. So I took your proposed sentence, but I added a parenthesis to clarify that we're talking about notes from 'git notes'.

Show 12 quoted lines
>
> We could go further to explain by adding something like that
> immediately after "keeping the object alive" above, e.g.
>
>     ---when an object becomes unreachable (e.g. a branch gets
>     rewound, a commit gets rewritten) and eventually gets pruned, a
>     note attached to the object will become dangling (use "git notes
>     prune" to remove them).
>
> but I am not sure if that is necessary.  Pruning notes attached to
> objects that are pruned may be relevant in the context of discussing
> "git gc", I guess.
Yes, seems only tangentially related, so I'll leave it out.
I'll send a v2 in a moment.
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 10 in “docs: clarify that refs/notes/ do not keep the attached objects alive”
  1. docs: clarify that refs/notes/ do not keep the attached objects aliveMartin von Zweigbergk, Feb 11, 2021
  2. Junio C HamanoFeb 11, 2021
  3. Martin von ZweigbergkFeb 11, 2021
  4. Junio C HamanoFeb 11, 2021
  5. Martin von ZweigbergkFeb 11, 2021
  6. docs: clarify that refs/notes/ do not keep the attached objects aliveMartin von Zweigbergk, Feb 11, 2021
  7. Junio C HamanoFeb 11, 2021
  8. Martin von ZweigbergkFeb 11, 2021
  9. docs: clarify that refs/notes/ do not keep the attached objects aliveMartin von Zweigbergk, Feb 11, 2021
  10. Junio C HamanoFeb 11, 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.