From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Chacon Subject: [PATCH] notes: accept any ref for merge Date: Fri, 19 Sep 2014 09:39:45 +0200 Message-ID: <1411112385-33479-1-git-send-email-schacon@gmail.com> Cc: Scott Chacon To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Sep 19 09:40:04 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUsnR-0000jj-54 for gcvg-git-2@plane.gmane.org; Fri, 19 Sep 2014 09:40:02 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbaISHj5 (ORCPT ); Fri, 19 Sep 2014 03:39:57 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:46869 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbaISHj4 (ORCPT ); Fri, 19 Sep 2014 03:39:56 -0400 Received: by mail-wg0-f46.google.com with SMTP id n12so1991059wgh.29 for ; Fri, 19 Sep 2014 00:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=nlospyNH0odSH3FFqfjUiDsrNCaEatpprNxZQt/5818=; b=egVps5BtxIbLoOpQ7aiRWrUawJKr6VazgFuvb6gdLacprifbuxUymnHMRvFGNaHDed wS5PbKO/mo8je/TanOhTKSTURL1n/62QBE6Q2rxuqsiTlY8ZO4MtI2bKupYXdFuSTYb+ zbqBjbRkcCzIlppYrRsC6P/vOF9JtmPp6Jyq8OW9ZSCSm5F9Se2jL7rh+c08sgWfSK9h GSrqy902XYh/wh4MKHJzHH/3n3Rp8qkOInDYZg83Ik1ztM6wl20gEx81+LIU/oKJiQTR ZTogX7iJb/qb1wN+5+smLYR2QCf7WrXNhth4sC4SfArsqc4BPM8hOYqap7Sa/S0GKCsm r3WA== X-Received: by 10.180.99.35 with SMTP id en3mr4610264wib.50.1411112395524; Fri, 19 Sep 2014 00:39:55 -0700 (PDT) Received: from localhost.localdomain (85-168-227-34.rev.numericable.fr. [85.168.227.34]) by mx.google.com with ESMTPSA id cz3sm1295818wjb.23.2014.09.19.00.39.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Sep 2014 00:39:54 -0700 (PDT) X-Mailer: git-send-email 2.0.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 --- 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