git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kyle J. McKay" <mackyle@gmail.com>
To: Git mailing list <git@vger.kernel.org>
Cc: Scott Chacon <schacon@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Johan Herland <johan@herland.net>, Jeff King <peff@peff.net>
Subject: [PATCH v2 1/2] notes: accept any ref
Date: Mon,  5 Jan 2015 22:03:52 -1000	[thread overview]
Message-ID: <4066d4aa9a52b58b40b3abed21eaf35@74d39fa044aa309eaea14b9f57fe79c> (raw)
In-Reply-To: <d4509363c8f670483dacdd2a5070f5a@74d39fa044aa309eaea14b9f57fe79c>

From: Scott Chacon <schacon@gmail.com>

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 c763a21e..7165a33f 100644
--- a/notes.c
+++ b/notes.c
@@ -1292,7 +1292,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.1.4

  reply	other threads:[~2015-01-06  8:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06  8:03 [PATCH v2 0/2] Accept any notes ref Kyle J. McKay
2015-01-06  8:03 ` Kyle J. McKay [this message]
2015-01-06  8:03 ` [PATCH v2 2/2] t/t3308-notes-merge.sh: succeed with relaxed notes refs Kyle J. McKay
2015-01-06 10:20   ` Junio C Hamano
2015-01-06 12:27     ` Kyle J. McKay
2015-01-06 18:25       ` Junio C Hamano
2015-01-06 23:29         ` Kyle J. McKay
2015-01-06 23:54           ` Junio C Hamano
2015-01-07  1:27             ` Kyle J. McKay
2015-01-07  0:28           ` Johan Herland
2015-01-07  1:51             ` Kyle J. McKay
2015-01-07 16:14             ` Junio C Hamano
2015-01-07  1:19       ` Johan Herland
2015-01-07  1:19     ` Jeff King
2015-01-07 16:03       ` Junio C Hamano
2015-01-08 10:31         ` Jeff King

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=4066d4aa9a52b58b40b3abed21eaf35@74d39fa044aa309eaea14b9f57fe79c \
    --to=mackyle@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.net \
    --cc=peff@peff.net \
    --cc=schacon@gmail.com \
    /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 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).