Storing notes refs outside of refs/
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
Quoted 1 line · Joshua Jensen
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.
----- Original Message -----
From: Junio C Hamano
Date: 8/26/2010 11:05 AM
Quoted 5 lines
Quoted 1 line · Joshua Jensen
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
Quoted 3 lines · Joshua Jensen
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?
----- Original Message -----
From: Junio C Hamano
Date: 8/26/2010 12:54 PM
Quoted 6 lines
Joshua Jensen<[email protected]> writes
Quoted 3 lines
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.
Quoted 4 lines
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
Quoted 5 lines · Junio C Hamano
Quoted 1 line · Joshua Jensen
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
Heya,
Quoted 2 lines · Tomas Carnecky
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.
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 9 lines · Sverre Rabbelier
Heya,
Quoted 2 lines · Tomas Carnecky
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