threads / discuss / 26280

How does 'git notes --ref' work?

Subject: How does 'git notes --ref' work?

## tl;dr

3 messages between Jan 14, 2011 and Jan 14, 2011.

replies: 2people: 2as markdown or json

Edwin Kempin· Jan 14, 2011, 10:21 UTC · lore

How does 'git notes --ref' work? If I try 'git notes --ref refs/meta/reject-commits add -m "reject" HEAD' then the note is added to 'refs/notes/refs/meta/reject-commits' and not as expected to 'refs/meta/reject-commits'.

The description of the --ref option says [1]: "The ref is taken to be in refs/notes/ if it is not qualified." What is a qualified ref?

Thanks, Edwin
[1] http://www.kernel.org/pub/software/scm/git/docs/git-notes.html
Johan Herland· Jan 14, 2011, 10:49 UTC · re: Edwin Kempin · lore

Re: How does 'git notes --ref' work?

On Friday 14 January 2011, Edwin Kempin wrote:
Show 8 quoted lines
> How does 'git notes --ref' work? If I try
> 'git notes --ref refs/meta/reject-commits add -m "reject" HEAD'
> then the note is added to 'refs/notes/refs/meta/reject-commits' and
> not as expected to 'refs/meta/reject-commits'.
>
> The description of the --ref option says [1]:
> "The ref is taken to be in refs/notes/ if it is not qualified."
> What is a qualified ref?

A qualified ref (in this context) is one that starts with refs/notes. If it doesn't start with refs/notes, then refs/notes is prepended to it.

This is a restriction we put in place to make sure the notes infrastructure didn't edit (i.e. damage) any refs outside the refs/notes/ namespace.

We will probably remove this restriction in a future Git version. Until then, please keep your notes within the refs/notes/ namespace.

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net

← back to recent threads