public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Sebastian Schuberth <sschuberth@gmail•com>,
	Jonathan Nieder <jrnieder@gmail•com>
Cc: Git Mailing List <git@vger•kernel.org>
Subject: Re: [PATCH] doc: clarify that notes can be attached to any type of stored object
Date: Mon, 04 Apr 2016 11:04:26 -0700	[thread overview]
Message-ID: <xmqqzit945ed.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAHGBnuPkPqJprOxR4zBuWitXqXt9XtpnjGPQWEv+-pYovh1b+A@mail.gmail.com> (Sebastian Schuberth's message of "Mon, 4 Apr 2016 10:10:38 +0200")

Sebastian Schuberth <sschuberth@gmail•com> writes:

>>> -It is also permitted for a notes ref to point directly to a tree
>>> -object, in which case the history of the notes can be read with
>>> +It is also permitted for a notes ref to point to any other object in
>>> +the object store besides commit objects, that is annotated tags, blobs
>>> +or trees. For the latter, the history of the notes can be read with
>>>  `git log -p -g <refname>`.
>>
>> I do not think this is correct place to patch.  The original is not
>> talking about what objects can have notes attached at all.  What it
>> explains is this.
>
> Thanks for the explanation, I was indeed misreading this. I'll try to
> clarify this section then, too. In order to do so, I think we should
> mention how to actually create a <refname> that directly points to a
> tree instead of a commit for the history of notes. Would you have an
> example how to do that?

Interesting.  This came from 9eb3f816 (Documentation/notes: document
format of notes trees, 2010-05-08):

    Documentation/notes: document format of notes trees

    Separate the specification of the notes format exposed in
    git-config.1 from the description of the option; or in other
    words, move the explanation for what to expect to find at
    refs/notes/commits from git-config.1 to git-notes.1.

    Suggested-by: Thomas Rast <trast@student•ethz.ch>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail•com>
    Signed-off-by: Junio C Hamano <gitster@pobox•com>

but I do not find a corresponding sentence that says a notes ref can
point at a tree in the text before the patch.

I highly suspect that "git notes add" and other Porcelain level
commands that manipulate an existing notes tree would be unhappy if
a notes ref is not a commit, as it is clear from the paragraph
before the one under discussion, i.e.

    Every notes change creates a new commit at the specified notes ref.
    You can therefore inspect the history of the notes by invoking, e.g.,
    `git log -p notes/commits`.  Currently the commit message only records
    which operation triggered the update, and the commit authorship is
    determined according to the usual rules (see linkgit:git-commit[1]).
    These details may change in the future.

that in order to create a "new" commit, setting the current one as
its parent, would require that the current one to be a commit and
not a bare tree.  "git notes list" and others that merely read from
the notes tree would probably work.

      reply	other threads:[~2016-04-04 18:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 10:09 [PATCH] doc: clarify that notes can be attached to any type of stored object Sebastian Schuberth
2016-04-01 15:31 ` Junio C Hamano
2016-04-01 16:47   ` Junio C Hamano
2016-04-04  8:33     ` Sebastian Schuberth
2016-04-04  8:37       ` [PATCH] doc: Clarify which objects notes can be attached to Sebastian Schuberth
2016-04-04 16:39       ` [PATCH] doc: clarify that notes can be attached to any type of stored object Junio C Hamano
2016-04-04  8:10   ` Sebastian Schuberth
2016-04-04 18:04     ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqzit945ed.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=sschuberth@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox