All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove restriction on notes ref base
@ 2010-11-02  0:16 Kenny Root
  2010-11-02  6:52 ` Jonathan Nieder
  0 siblings, 1 reply; 21+ messages in thread
From: Kenny Root @ 2010-11-02  0:16 UTC (permalink / raw)
  To: git; +Cc: Kenny Root

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.

Signed-off-by: Kenny Root <kroot@google.com>
---
 builtin/notes.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 6d07aac..9acce7b 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -343,11 +343,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
 	} else if (!c->refs_from_env && !strcmp(k, "notes.rewriteref")) {
 		/* note that a refs/ prefix is implied in the
 		 * underlying for_each_glob_ref */
-		if (!prefixcmp(v, "refs/notes/"))
-			string_list_add_refs_by_glob(c->refs, v);
-		else
-			warning("Refusing to rewrite notes in %s"
-				" (outside of refs/notes/)", v);
+		string_list_add_refs_by_glob(c->refs, v);
 		return 0;
 	}
 
@@ -473,9 +469,6 @@ static struct notes_tree *init_notes_check(const char *subcommand)
 	init_notes(NULL, NULL, NULL, 0);
 	t = &default_notes_tree;
 
-	if (prefixcmp(t->ref, "refs/notes/"))
-		die("Refusing to %s notes in %s (outside of refs/notes/)",
-		    subcommand, t->ref);
 	return t;
 }
 
@@ -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/");
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-11-05 15:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.