# How does 'git notes --ref' work?

3 messages from 2011-01-14 to 2011-01-14. Participants: Edwin Kempin, Johan Herland.
Thread: https://gitlist.dev/t/26280

## Edwin Kempin, 2011-01-14 10:21

Subject: How does 'git notes --ref' work?
Message-ID: <AANLkTimL137aFt2dyvdHxTMUjB4diwJQG-FQiYEK8tVJ@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimL137aFt2dyvdHxTMUjB4diwJQG-FQiYEK8tVJ%40mail.gmail.com

```
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, 2011-01-14 10:49

Subject: Re: How does 'git notes --ref' work?
Message-ID: <201101141149.38778.johan@herland.net>
URL: https://gitlist.dev/e/201101141149.38778.johan%40herland.net
In-Reply-To: <AANLkTimL137aFt2dyvdHxTMUjB4diwJQG-FQiYEK8tVJ@mail.gmail.com>

```
On Friday 14 January 2011, Edwin Kempin wrote:
> 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

```

## Edwin Kempin, 2011-01-14 11:14

Subject: Re: How does 'git notes --ref' work?
Message-ID: <AANLkTimV6LguyjJEiECAVg1zLj=v-GQkrkxBez6t9HHf@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimV6LguyjJEiECAVg1zLj%3Dv-GQkrkxBez6t9HHf%40mail.gmail.com
In-Reply-To: <201101141149.38778.johan@herland.net>

```
Thanks for the clarification.

```
