# Storing notes refs outside of refs/

8 messages from 2010-08-26 to 2010-08-26. Participants: Joshua Jensen, Junio C Hamano, Tomas Carnecky, Sverre Rabbelier.
Thread: https://gitlist.dev/t/24869

## Joshua Jensen, 2010-08-26 15:02

Subject: Storing notes refs outside of refs/
Message-ID: <4C7681F1.3070205@workspacewhiz.com>
URL: https://gitlist.dev/e/4C7681F1.3070205%40workspacewhiz.com

```
  Every push to our server creates a note at .git/refs/notes/p4notes 
with the equivalent Perforce changelist number, so Git-controlled code 
and Perforce-controlled content can stay in sync.

gitk --all and Git Extensions (out of box) show all entries in the 
.git/refs/.  The p4notes entries are intermixed with the regular branch 
content.  This creates a HORRID visual mess.

I tried manually moving .git/refs/notes/p4notes to .git/p4/p4notes.

"git log --show-notes=p4/p4notes" fails, but assigning 
core.notesDisplayRef=p4/p4notes succeeds.

The best part is, the refs/* namespace is no longer cluttered with junk!

However, "git push origin p4/p4notes:p4/p4notes" fails with the error: 
Unable to push to unqualified destination: p4/p4notes.  The destination 
refspec neither matches an existing ref on the remote nor begins with 
refs/, and we are unable to guess a prefix based on the source ref.

Is there a way to make the "git push" work?

Thanks!

Josh

```

## Junio C Hamano, 2010-08-26 17:05

Subject: Re: Storing notes refs outside of refs/
Message-ID: <7vy6btl2yo.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy6btl2yo.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4C7681F1.3070205@workspacewhiz.com>

```
Joshua Jensen <jjensen@workspacewhiz.com> writes:

> I tried manually moving .git/refs/notes/p4notes to .git/p4/p4notes.

Bad idea.  Your notes no longer are protected from fsck and prune.

Don't do it.

```

## Joshua Jensen, 2010-08-26 18:25

Subject: Re: Storing notes refs outside of refs/
Message-ID: <4C76B186.5080809@workspacewhiz.com>
URL: https://gitlist.dev/e/4C76B186.5080809%40workspacewhiz.com
In-Reply-To: <7vy6btl2yo.fsf@alter.siamese.dyndns.org>

```
  ----- Original Message -----
From: Junio C Hamano
Date: 8/26/2010 11:05 AM
> Joshua Jensen<jjensen@workspacewhiz.com>  writes:
>> I tried manually moving .git/refs/notes/p4notes to .git/p4/p4notes.
> Bad idea.  Your notes no longer are protected from fsck and prune.
>
> Don't do it.
And had I thought for longer than 1 minute about it, I would have 
realized that.

Okay then...

gitk --all --not --glob=refs/notes/*

does not work.  Is there a way to make it work?  I think, from another 
conversation asking a different (but related) question, the answer is no.

Josh

```

## Tomas Carnecky, 2010-08-26 18:47

Subject: Re: Storing notes refs outside of refs/
Message-ID: <4C76B6CF.8040808@dbservice.com>
URL: https://gitlist.dev/e/4C76B6CF.8040808%40dbservice.com
In-Reply-To: <7vy6btl2yo.fsf@alter.siamese.dyndns.org>

```
On 8/26/10 7:05 PM, Junio C Hamano wrote:
> Joshua Jensen <jjensen@workspacewhiz.com> writes:
> 
>> I tried manually moving .git/refs/notes/p4notes to .git/p4/p4notes.
> 
> Bad idea.  Your notes no longer are protected from fsck and prune.

Hm, so storing no longer needed branches outside of the refs/heads
namespace (so that they don't show up in git branch) is a bad idea? This
suggestion was made in #git today or yesterday and I'd like to know if I
should advise people against doing that.

tom

```

## Sverre Rabbelier, 2010-08-26 18:51

Subject: Re: Storing notes refs outside of refs/
Message-ID: <AANLkTim=P6GwnhuaJrixCZB_USD0NrKT0nN4t6XyEY+6@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim%3DP6GwnhuaJrixCZB_USD0NrKT0nN4t6XyEY%2B6%40mail.gmail.com
In-Reply-To: <4C76B6CF.8040808@dbservice.com>

```
Heya,

On Thu, Aug 26, 2010 at 13:47, Tomas Carnecky <tom@dbservice.com> wrote:
> Hm, so storing no longer needed branches outside of the refs/heads
> namespace (so that they don't show up in git branch) is a bad idea?

You can store them outside refs/heads just fine, as long as they're
somewhere under refs. For example, refs/attic/ would be perfectly
safe.

-- 
Cheers,

Sverre Rabbelier

```

## Junio C Hamano, 2010-08-26 18:54

Subject: Re: Storing notes refs outside of refs/
Message-ID: <7vlj7tkxvn.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vlj7tkxvn.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4C76B186.5080809@workspacewhiz.com>

```
Joshua Jensen <jjensen@workspacewhiz.com> writes:

> gitk --all --not --glob=refs/notes/*
>
> does not work.

I don't think --not there is a good idea because "--not" in rev-list
parameter means "not reachable from the following commits".

It may be useful if you made "--all --glob=!refs/notes/*" to work,
though.  I could picture myself buying such a change.

Or just use "--branches --tags" instead, perhaps?

```

## Tomas Carnecky, 2010-08-26 19:09

Subject: Re: Storing notes refs outside of refs/
Message-ID: <4C76BBEB.3040700@dbservice.com>
URL: https://gitlist.dev/e/4C76BBEB.3040700%40dbservice.com
In-Reply-To: <AANLkTim=P6GwnhuaJrixCZB_USD0NrKT0nN4t6XyEY+6@mail.gmail.com>

```
On 8/26/10 8:51 PM, Sverre Rabbelier wrote:
> Heya,
> 
> On Thu, Aug 26, 2010 at 13:47, Tomas Carnecky <tom@dbservice.com> wrote:
>> Hm, so storing no longer needed branches outside of the refs/heads
>> namespace (so that they don't show up in git branch) is a bad idea?
> 
> You can store them outside refs/heads just fine, as long as they're
> somewhere under refs. For example, refs/attic/ would be perfectly
> safe.

Ah, I missed that Joshua wants to put them outside of .git/refs
(.git/p4). Slight but important difference :)

tom

```

## Joshua Jensen, 2010-08-26 19:20

Subject: Re: Storing notes refs outside of refs/
Message-ID: <4C76BE90.6040902@workspacewhiz.com>
URL: https://gitlist.dev/e/4C76BE90.6040902%40workspacewhiz.com
In-Reply-To: <7vlj7tkxvn.fsf@alter.siamese.dyndns.org>

```
  ----- Original Message -----
From: Junio C Hamano
Date: 8/26/2010 12:54 PM
> Joshua Jensen<jjensen@workspacewhiz.com>  writes
>> gitk --all --not --glob=refs/notes/*
>>
>> does not work.
> I don't think --not there is a good idea because "--not" in rev-list
> parameter means "not reachable from the following commits".
Okay.  I've not used it before.
> It may be useful if you made "--all --glob=!refs/notes/*" to work,
> though.  I could picture myself buying such a change.
>
> Or just use "--branches --tags" instead, perhaps?
gitk --branches --remotes --tags is long to type.  (Let's ignore git 
aliases for the moment.)

The deal is, refs/notes/ showing in git log --all serves no purpose, in 
my opinion.  If it does for somebody else, I'd love to hear.

What if there was a configuration setting applied to 'git log --all' as 
a filter for refs I never want to see in the --all view?

git config --add core.logfilter refs/notes/*
git config --add core.logfilter refs/game-p4/*

I also like the negated --glob syntax you showed above.

Another possibly useful idea is an extra 'git log' parameter --brt (for 
--branches, --remotes, --tags).

Thoughts?  I'll see if I can find some time to work on something once I 
have a bit of direction.

Josh

```
