All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: Kenny Root <kroot@google.com>
Cc: git@vger.kernel.org, Jonathan Nieder <jrnieder@gmail.com>,
	Thomas Rast <trast@student.ethz.ch>
Subject: Re: [PATCH] Remove restriction on notes ref base
Date: Tue, 02 Nov 2010 09:48:22 +0100	[thread overview]
Message-ID: <201011020948.22677.johan@herland.net> (raw)
In-Reply-To: <20101102065208.GA4280@burratino>

On Tuesday 02 November 2010, Jonathan Nieder wrote:
> (+cc: Johan, Thomas)
> 
> Kenny Root wrote:
> > Git notes were restricted to refs/notes/* in the command line
> > utilities, but setting things like GIT_NOTES_REF to something outside
> > of that structure would work.
> > 
> > This removes the restrictions on the git notes command line interface.

Why do you need to set GIT_NOTES_REF to something outside refs/notes/ at 
all?

> Could you explain what those restrictions are (perhaps through an
> example in the form of a patch to the t/ subdirectory)?

Yes, please do. As it stands, I'm pretty sure the patch below breaks at 
least TCs t3301.4 and t3301.5.

> Cc-ing some people more knowledgeable about notes than I am; maybe
> they can give more information about what this notes.rewriteref
> protection and other check are about.

Well, I guess we originally decided to limit notes refs to within 
refs/notes/ in order to clearly separate notes from non-notes, and to 
prevent notes code from accidentally messing up non-notes refs.

Later, we have discovered that in order to work with remote notes refs, we 
probably have to lift this restriction, and allow (at least) notes refs 
somewhere within refs/remotes/, e.g. refs/remotes/*/notes/.

http://thread.gmane.org/gmane.comp.version-control.git/159469/focus=159703 
and its sub-thread contains more discussion on sharing notes with remote 
repos.

So, in conclusion, this patch is a move in the right direction, but in some 
respects it might be going a bit _too_ far: Maybe we should restrict notes 
to refs/notes/ and refs/remotes/*/notes/? ...or maybe I'm too paranoid, and 
allowing notes "everywhere" is ok. Then again, in other respects this patch 
isn't going far enough, since it doesn't deal with setting up the refspecs 
needed to make notes sharing easy and straighforward for end users.

> [patch follows for their convenience.]
> [...]
> > @@ -844,7 +837,7 @@ int cmd_notes(int argc, const char **argv, const
> > char *prefix)
> > 
> >  	if (override_notes_ref) {
> >  	
> >  		struct strbuf sb = STRBUF_INIT;
> > 
> > -		if (!prefixcmp(override_notes_ref, "refs/notes/"))
> > +		if (!prefixcmp(override_notes_ref, "refs/"))
> > 
> >  			/* we're happy */;
> >  		
> >  		else if (!prefixcmp(override_notes_ref, "notes/"))
> >  		
> >  			strbuf_addstr(&sb, "refs/");

FTR, this hunk will surely conflict with the introduction of 
expand_notes_ref() which is in patch 09/23 in the 'git notes merge' series 
in 'pu'.


...Johan

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

  reply	other threads:[~2010-11-02  8:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  0:16 [PATCH] Remove restriction on notes ref base Kenny Root
2010-11-02  6:52 ` Jonathan Nieder
2010-11-02  8:48   ` Johan Herland [this message]
2010-11-02 14:11     ` Shawn Pearce
2010-11-02 14:29       ` Jeff King
2010-11-02 15:24       ` Johan Herland
2010-11-02 17:41       ` Junio C Hamano
2010-11-02 22:58         ` Johan Herland
2010-11-02 23:28           ` Chris Forbes
2010-11-03  6:41           ` Jonathan Nieder
2010-11-03 16:17             ` Junio C Hamano
2010-11-03 16:30               ` Sverre Rabbelier
2010-11-04  0:49                 ` Johan Herland
2010-11-04  1:00                   ` Sverre Rabbelier
2010-11-04 14:35                   ` Tag refspecs (was Re: [PATCH] Remove restriction on notes ref base) Marc Branchaud
2010-11-05  1:02                     ` Johan Herland
2010-11-05 15:11                       ` Marc Branchaud
2010-11-04 14:58                   ` [PATCH] Remove restriction on notes ref base Jeff King
2010-11-05  1:29                     ` Johan Herland
2010-11-05 14:55                       ` Jeff King
2010-11-03 16:35               ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201011020948.22677.johan@herland.net \
    --to=johan@herland.net \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=kroot@google.com \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.