git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] notes: accept any ref

From
Kyle J. McKay <mackyle@gmail.com>
Date
Jan 6, 2015, 08:03 UTC
Message-ID
<4066d4aa9a52b58b40b3abed21eaf35@74d39fa044aa309eaea14b9f57fe79c>
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
Previous: Kyle J. McKayNext: Kyle J. McKay
Message 2 of 16 in “Accept any notes ref”
  1. 0/2 Accept any notes refKyle J. McKay, Jan 6, 2015
  2. 1/2 notes: accept any refKyle J. McKay, Jan 6, 2015
  3. 2/2 t/t3308-notes-merge.sh: succeed with relaxed notes refsKyle J. McKay, Jan 6, 2015
  4. Junio C HamanoJan 6, 2015
  5. Kyle J. McKayJan 6, 2015
  6. Junio C HamanoJan 6, 2015
  7. Kyle J. McKayJan 6, 2015
  8. Junio C HamanoJan 6, 2015
  9. Kyle J. McKayJan 7, 2015
  10. Johan HerlandJan 7, 2015
  11. Kyle J. McKayJan 7, 2015
  12. Junio C HamanoJan 7, 2015
  13. Johan HerlandJan 7, 2015
  14. Jeff KingJan 7, 2015
  15. Junio C HamanoJan 7, 2015
  16. Jeff KingJan 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.