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

[PATCH] notes: accept any ref for merge

From
Scott Chacon <schacon@gmail.com>
Date
Sep 19, 2014, 07:39 UTC
Message-ID
<1411112385-33479-1-git-send-email-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 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
Next: Jeff King
Message 1 of 9 in “notes: accept any ref for merge”
  1. notes: accept any ref for mergeScott Chacon, Sep 19, 2014
  2. Jeff KingSep 19, 2014
  3. Johan HerlandSep 19, 2014
  4. Junio C HamanoSep 19, 2014
  5. Johan HerlandSep 20, 2014
  6. Junio C HamanoSep 22, 2014
  7. Kyle J. McKayNov 22, 2014
  8. Jeff KingDec 4, 2014
  9. Junio C HamanoSep 19, 2014

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.