git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] notes: accept any ref for merge
@ 2014-09-19  7:39 Scott Chacon
  2014-09-19  9:39 ` Jeff King
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Chacon @ 2014-09-19  7:39 UTC (permalink / raw)
  To: git; +Cc: Scott Chacon

Currently if you try to merge notes, the notes code ensures that the
reference is under the 'refs/notes' namespace. In order to do any sort
of collaborative workflow, this doesn't work well as you can't easily
have local notes refs seperate from remote notes refs.

This patch changes the expand_notes_ref function to check for simply a
leading refs/ instead of refs/notes to check if we're being passed an
expanded notes reference. This would allow us to set up
refs/remotes-notes or otherwise keep mergeable notes references outside
of what would be contained in the notes push refspec.

Signed-off-by: Scott Chacon <schacon@gmail.com>
---
 notes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/notes.c b/notes.c
index 5fe691d..78d58af 100644
--- a/notes.c
+++ b/notes.c
@@ -1293,7 +1293,7 @@ int copy_note(struct notes_tree *t,
 
 void expand_notes_ref(struct strbuf *sb)
 {
-	if (starts_with(sb->buf, "refs/notes/"))
+	if (starts_with(sb->buf, "refs/"))
 		return; /* we're happy */
 	else if (starts_with(sb->buf, "notes/"))
 		strbuf_insert(sb, 0, "refs/", 5);
-- 
2.0.0

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

end of thread, other threads:[~2014-12-04 10:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19  7:39 [PATCH] notes: accept any ref for merge Scott Chacon
2014-09-19  9:39 ` Jeff King
2014-09-19 14:01   ` Johan Herland
2014-09-19 18:22     ` Junio C Hamano
2014-09-20  0:01       ` Johan Herland
2014-09-22 17:34         ` Junio C Hamano
2014-11-22 18:04       ` Kyle J. McKay
2014-12-04 10:26         ` Jeff King
2014-09-19 17:29   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).