threads / discuss / 24869

Storing notes refs outside of refs/

Subject: Storing notes refs outside of refs/

## tl;dr

8 messages between Aug 26, 2010 and Aug 26, 2010.

replies: 7people: 4as markdown or json

Joshua Jensen· Aug 26, 2010, 15:02 UTC · lore
  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· Aug 26, 2010, 17:05 UTC · re: Joshua Jensen · lore

Re: Storing notes refs outside of refs/

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· Aug 26, 2010, 18:25 UTC · re: Junio C Hamano · lore

Re: Storing notes refs outside of refs/

  ----- Original Message -----
From: Junio C Hamano
Date: 8/26/2010 11:05 AM
Show 5 quoted lines
> 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
Junio C Hamano· Aug 26, 2010, 18:54 UTC · re: Joshua Jensen · lore

Re: Storing notes refs outside of refs/

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?
Joshua Jensen· Aug 26, 2010, 19:20 UTC · re: Junio C Hamano · lore

Re: Storing notes refs outside of refs/

  ----- Original Message -----
From: Junio C Hamano
Date: 8/26/2010 12:54 PM
Show 6 quoted lines
> 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
Tomas Carnecky· Aug 26, 2010, 18:47 UTC · re: Junio C Hamano · lore

Re: Storing notes refs outside of refs/

On 8/26/10 7:05 PM, Junio C Hamano wrote:
Show 5 quoted lines
> 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· Aug 26, 2010, 18:51 UTC · re: Tomas Carnecky · lore

Re: Storing notes refs outside of refs/

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
Tomas Carnecky· Aug 26, 2010, 19:09 UTC · re: Sverre Rabbelier · lore

Re: Storing notes refs outside of refs/

On 8/26/10 8:51 PM, Sverre Rabbelier wrote:
Show 9 quoted lines
> 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

← back to recent threads