{"thread":{"id":"31447","subject":"[PATCH 0/2] Add --expand to 'git notes get-ref'","startedAt":"2012-09-05T12:48:13Z","lastAt":"2012-09-10T20:21:09Z","messageCount":11,"participants":["W. Trevor King","Johan Herland","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"198385","messageId":"cover.1346848834.git.wking@tremily.us","threadId":"31447","inReplyTo":null,"subject":"[PATCH 0/2] Add --expand to 'git notes get-ref'","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2012-09-05T12:48:13Z","receivedAt":"2012-09-05T12:48:13Z","isPatch":true,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"From: \"W. Trevor King\" <wking@tremily.us>\n\nI was recently confused when\n\n  $ git notes merge -v refs/remotes/origin/notes/commits\n\nfailed to do (or print) anything.  It turns out that note refs must\nlive under 'refs/notes/', so my command line ref was expanding to\n\n  refs/notes/refs/remotes/origin/notes/commits\n\nwhich wasn't matching anything.\n\nThe first of my commits here adds the '--expand' option, so you can\nsee how Git is expanding your ref internally:\n\n  $ GIT_NOTES_REF=commits git notes get-ref --expand\n  refs/notes/commits\n\nThe second commit makes the expansion less strict about the location\nof note refs.  In his initial mail introducing 'git notes', Johan says\nthat note refs should live under 'refs/notes' [1].  This seems like a\ngood place for local notes, but note refs from remote repos should\nprobably live somewhere else (e.g. 'refs/remote-notes/' or\n'refs/remotes/<name>/notes/'.  In the initial thread there are a few\nmessages talking about looking up reverse mappings under 'refs/notes/',\nbut this seems to all have been before the 'refs/notes/<namespace>/'\nstage.  If I'm missing a good reason to keep everything under\n'refs/notes/', feel free to ignore the second patch.\n\nCheers,\nTrevor\n\n[1]: http://permalink.gmane.org/gmane.comp.version-control.git/48540\n\n\nW. Trevor King (2):\n  notes get-ref: --expand expands the output notes ref.\n  notes: don't alter refs starting with 'refs/' in expand_notes_ref\n\n Documentation/git-notes.txt |  6 +++++-\n builtin/notes.c             | 26 +++++++++++++++++++++-----\n notes.c                     |  2 +-\n t/t3301-notes.sh            | 12 ++++++++++++\n 4 files changed, 39 insertions(+), 7 deletions(-)\n\n-- \n1.7.12.176.g3fc0e4c.dirty\n"},{"id":"198387","messageId":"4eea4f3eab8ee827a40802a50aa2cda9e4b43943.1346849556.git.wking@tremily.us","threadId":"31447","inReplyTo":"cover.1346848834.git.wking@tremily.us","subject":"[PATCH 1/2] notes get-ref: --expand expands the output notes ref.","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2012-09-05T12:52:44Z","receivedAt":"2012-09-05T12:52:44Z","isPatch":true,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"From: \"W. Trevor King\" <wking@tremily.us>\n\nUseful for debugging refs that don't seem to be expanding correctly.\n\nSigned-off-by: W. Trevor King <wking@tremily.us>\n---\n Documentation/git-notes.txt |  6 +++++-\n builtin/notes.c             | 26 +++++++++++++++++++++-----\n t/t3301-notes.sh            |  8 ++++++++\n 3 files changed, 34 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt\nindex b95aafa..a93d211 100644\n--- a/Documentation/git-notes.txt\n+++ b/Documentation/git-notes.txt\n@@ -19,7 +19,7 @@ SYNOPSIS\n 'git notes' merge --abort [-v | -q]\n 'git notes' remove [--ignore-missing] [--stdin] [<object>...]\n 'git notes' prune [-n | -v]\n-'git notes' get-ref\n+'git notes' get-ref [-e]\n \n \n DESCRIPTION\n@@ -165,6 +165,10 @@ OPTIONS\n \tinput (there is no reason you cannot combine this with object\n \tnames from the command line).\n \n+-e::\n+--expand::\n+  Expand the notes ref before printing it.\n+\n -n::\n --dry-run::\n \tDo not remove anything; just report the object names whose notes\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 3644d14..17c6136 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -31,7 +31,7 @@ static const char * const git_notes_usage[] = {\n \t\"git notes merge --abort [-v | -q]\",\n \t\"git notes [--ref <notes_ref>] remove [<object>...]\",\n \t\"git notes [--ref <notes_ref>] prune [-n | -v]\",\n-\t\"git notes [--ref <notes_ref>] get-ref\",\n+\t\"git notes [--ref <notes_ref>] get-ref [-e]\",\n \tNULL\n };\n \n@@ -84,7 +84,7 @@ static const char * const git_notes_prune_usage[] = {\n };\n \n static const char * const git_notes_get_ref_usage[] = {\n-\t\"git notes get-ref\",\n+\t\"git notes get-ref [<options>]\",\n \tNULL\n };\n \n@@ -1046,16 +1046,32 @@ static int prune(int argc, const char **argv, const char *prefix)\n \n static int get_ref(int argc, const char **argv, const char *prefix)\n {\n-\tstruct option options[] = { OPT_END() };\n+\tconst char *ref;\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tint expand = 0;\n+\tstruct option options[] = {\n+\t\tOPT_BOOL('e', \"expand\", &expand,\n+\t\t         \"expand the notes ref before printing it\"),\n+\t\tOPT_END()\n+\t};\n \targc = parse_options(argc, argv, prefix, options,\n \t\t\t     git_notes_get_ref_usage, 0);\n \n-\tif (argc) {\n+\tif (argc > 1) {\n \t\terror(\"too many parameters\");\n \t\tusage_with_options(git_notes_get_ref_usage, options);\n \t}\n \n-\tputs(default_notes_ref());\n+\tref = default_notes_ref();\n+\tif (expand) {\n+\t\tstrbuf_insert(&buf, 0, ref, strlen(ref));\n+\t\texpand_notes_ref(&buf);\n+\t\tputs(buf.buf);\n+\t\tstrbuf_release(&buf);\n+\t} else {\n+\t\tputs(ref);\n+\t}\t\n+\n \treturn 0;\n }\n \ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex 16de05a..c0486a0 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -1222,4 +1222,12 @@ test_expect_success 'git notes get-ref (--ref)' '\n \ttest \"$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)\" = \"refs/notes/baz\"\n '\n \n+test_expect_success 'git notes get-ref (no expand)' '\n+\ttest \"$(GIT_NOTES_REF=commits git notes get-ref)\" = \"commits\"\n+'\n+\n+test_expect_success 'git notes get-ref (--expand)' '\n+\ttest \"$(GIT_NOTES_REF=commits git notes get-ref --expand)\" = \"refs/notes/commits\"\n+'\n+\n test_done\n-- \n1.7.12.176.g3fc0e4c.dirty\n"},{"id":"198386","messageId":"8c65d450f545ad3f6a241ef1b95fca272ec3a38a.1346849556.git.wking@tremily.us","threadId":"31447","inReplyTo":"cover.1346848834.git.wking@tremily.us","subject":"[PATCH 2/2] notes: don't alter refs starting with 'refs/' in expand_notes_ref","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2012-09-05T12:52:45Z","receivedAt":"2012-09-05T12:52:45Z","isPatch":true,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"From: \"W. Trevor King\" <wking@tremily.us>\n\nThis avoids surprising cases like:\n\n  $ GIT_NOTES_REF=refs/remotes/origin/notes/commits git notes get-ref --expand\n  refs/notes/refs/remotes/origin/notes/commits\n\nWith the old implementation, all note refs had to live under\n'refs/notes/' which was not mentioned in the git-notes.txt.\n\nSigned-off-by: W. Trevor King <wking@tremily.us>\n---\n notes.c          | 2 +-\n t/t3301-notes.sh | 4 ++++\n 2 files changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/notes.c b/notes.c\nindex 93e9868..60394c8 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -1289,7 +1289,7 @@ int copy_note(struct notes_tree *t,\n \n void expand_notes_ref(struct strbuf *sb)\n {\n-\tif (!prefixcmp(sb->buf, \"refs/notes/\"))\n+\tif (!prefixcmp(sb->buf, \"refs/\"))\n \t\treturn; /* we're happy */\n \telse if (!prefixcmp(sb->buf, \"notes/\"))\n \t\tstrbuf_insert(sb, 0, \"refs/\", 5);\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex c0486a0..707d7e6 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -1230,4 +1230,8 @@ test_expect_success 'git notes get-ref (--expand)' '\n \ttest \"$(GIT_NOTES_REF=commits git notes get-ref --expand)\" = \"refs/notes/commits\"\n '\n \n+test_expect_success 'git notes get-ref (--expand)' '\n+\ttest \"$(GIT_NOTES_REF=refs/remotes/origin/notes/commits git notes get-ref --expand)\" = \"refs/remotes/origin/notes/commits\"\n+'\n+\n test_done\n-- \n1.7.12.176.g3fc0e4c.dirty\n"},{"id":"198391","messageId":"CALKQrgem2KM07vA0LeVgD6HkM1yMDBSfThKUZ7aBaxpbcC49hA@mail.gmail.com","threadId":"31447","inReplyTo":"4eea4f3eab8ee827a40802a50aa2cda9e4b43943.1346849556.git.wking@tremily.us","subject":"Re: [PATCH 1/2] notes get-ref: --expand expands the output notes ref.","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-05T15:49:10Z","receivedAt":"2012-09-05T15:49:10Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wed, Sep 5, 2012 at 2:52 PM, W. Trevor King <wking@tremily.us> wrote:\n> From: \"W. Trevor King\" <wking@tremily.us>\n>\n> Useful for debugging refs that don't seem to be expanding correctly.\n>\n> Signed-off-by: W. Trevor King <wking@tremily.us>\n\nAcked-by: Johan Herland <johan@herland.net>\n\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"198390","messageId":"CALKQrgdRqd59pfLtpROwxtrFjvO5oYgKKN3KCp1NA4aMEEcj1w@mail.gmail.com","threadId":"31447","inReplyTo":"cover.1346848834.git.wking@tremily.us","subject":"Re: [PATCH 0/2] Add --expand to 'git notes get-ref'","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-05T15:58:37Z","receivedAt":"2012-09-05T15:58:37Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wed, Sep 5, 2012 at 2:48 PM, W. Trevor King <wking@tremily.us> wrote:\n> The second commit makes the expansion less strict about the location\n> of note refs.  In his initial mail introducing 'git notes', Johan says\n> that note refs should live under 'refs/notes' [1].  This seems like a\n> good place for local notes, but note refs from remote repos should\n> probably live somewhere else (e.g. 'refs/remote-notes/' or\n> 'refs/remotes/<name>/notes/'.  In the initial thread there are a few\n> messages talking about looking up reverse mappings under 'refs/notes/',\n> but this seems to all have been before the 'refs/notes/<namespace>/'\n> stage.  If I'm missing a good reason to keep everything under\n> 'refs/notes/', feel free to ignore the second patch.\n\nThis has been discussed a couple of times on this list, but it never\nresulted in any actual changes. Read up on this thread to get some\ncontext:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/160503\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"198395","messageId":"20120905175344.GA8619@odin.tremily.us","threadId":"31447","inReplyTo":"CALKQrgdRqd59pfLtpROwxtrFjvO5oYgKKN3KCp1NA4aMEEcj1w@mail.gmail.com","subject":"Re: [PATCH 0/2] Add --expand to 'git notes get-ref'","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2012-09-05T17:53:44Z","receivedAt":"2012-09-05T17:53:44Z","isPatch":true,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"On Wed, Sep 05, 2012 at 05:58:37PM +0200, Johan Herland wrote:\n> On Wed, Sep 5, 2012 at 2:48 PM, W. Trevor King <wking@tremily.us> wrote:\n> > If I'm missing a good reason to keep everything under\n> > 'refs/notes/', feel free to ignore the second patch.\n> \n> This has been discussed a couple of times on this list, but it never\n> resulted in any actual changes. Read up on this thread to get some\n> context:\n> \n> http://thread.gmane.org/gmane.comp.version-control.git/160503\n\nThanks for the pointer, it looks like there are a bunch of good ideas.\nI assume the lack of changes was due to nobody having the\ntime/inclination to implement\n\n  http://article.gmane.org/gmane.comp.version-control.git/160655\n\nTrevor\n\n-- \nAs a side note, does anyone know of a thread-specific version of\n\n  http://download.gmane.org/<xyz>/<start>/<stop>\n\nIt would be easier for me (and less load for them) if I could run\n\n  http://download.gmane.org/gmane.comp.version-control.git/thread/160503\n\n-- \nThis email may be signed or encrypted with GnuPG (http://www.gnupg.org).\nFor more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\n"},{"id":"198407","messageId":"CALKQrgc-NZJrxvm_gJcWYCpsOprF=Rzf8=jGuARoit53T8KVkw@mail.gmail.com","threadId":"31447","inReplyTo":"20120905175344.GA8619@odin.tremily.us","subject":"Re: [PATCH 0/2] Add --expand to 'git notes get-ref'","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-05T22:44:06Z","receivedAt":"2012-09-05T22:44:06Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wed, Sep 5, 2012 at 7:53 PM, W. Trevor King <wking@tremily.us> wrote:\n> On Wed, Sep 05, 2012 at 05:58:37PM +0200, Johan Herland wrote:\n>> On Wed, Sep 5, 2012 at 2:48 PM, W. Trevor King <wking@tremily.us> wrote:\n>> > If I'm missing a good reason to keep everything under\n>> > 'refs/notes/', feel free to ignore the second patch.\n>>\n>> This has been discussed a couple of times on this list, but it never\n>> resulted in any actual changes. Read up on this thread to get some\n>> context:\n>>\n>> http://thread.gmane.org/gmane.comp.version-control.git/160503\n>\n> Thanks for the pointer, it looks like there are a bunch of good ideas.\n> I assume the lack of changes was due to nobody having the\n> time/inclination to implement\n>\n>   http://article.gmane.org/gmane.comp.version-control.git/160655\n\nYes, I think time/inclination probably has a lot to do with it. Also,\nI forgot to link to the largest mailing list thread that discusses\nthese changes in _much_ more detail:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/165799/focus=165885\n\nAs you can see, the discussion quickly balloons into something much\nlarger than a simple discussion of where remote notes should be\nlocated...\n\nThat said, your patch 2/2 might be an acceptable stopgap measure for\nthe time being, and then we can reevaluate it if/when we implement a\nlarger ref restructuring.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"198419","messageId":"7v4nnb67x1.fsf@alter.siamese.dyndns.org","threadId":"31447","inReplyTo":"CALKQrgem2KM07vA0LeVgD6HkM1yMDBSfThKUZ7aBaxpbcC49hA@mail.gmail.com","subject":"Re: [PATCH 1/2] notes get-ref: --expand expands the output notes ref.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-06T05:23:54Z","receivedAt":"2012-09-06T05:23:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johan Herland <johan@herland.net> writes:\n\n> On Wed, Sep 5, 2012 at 2:52 PM, W. Trevor King <wking@tremily.us> wrote:\n>> From: \"W. Trevor King\" <wking@tremily.us>\n>>\n>> Useful for debugging refs that don't seem to be expanding correctly.\n>>\n>> Signed-off-by: W. Trevor King <wking@tremily.us>\n>\n> Acked-by: Johan Herland <johan@herland.net>\n\nReally?  Would \"git log --expand master\" be useful?\n\nI'd have to say that a DWIM that the user needs to diagnose with\nsuch a \"feature\" is a total failure.  Can't we fix that root cause\ninstead?\n\nThat is, for a name, e.g. \"refs/remotes/origin/notes/commit\" (the\noriginal example in [PATCH 0/2]) or \"commit\" (the usual):\n\n - If it is already a ref, just use that (e.g. use that stuff in the\n   refs/remotes/ hierarchy); or\n\n - If it is not, prefix refs/notes/ to it.\n\nor something?\n"},{"id":"198425","messageId":"20120906061147.GA11770@odin.tremily.us","threadId":"31447","inReplyTo":"7v4nnb67x1.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] notes get-ref: --expand expands the output notes ref.","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2012-09-06T06:11:48Z","receivedAt":"2012-09-06T06:11:48Z","isPatch":true,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"On Wed, Sep 05, 2012 at 10:23:54PM -0700, Junio C Hamano wrote:\n> Really?  Would \"git log --expand master\" be useful?\n\nI'm clearly not an expert on this, but isn't that what\n\n  git show-ref master\n\nis for?  Or is the fact that show-ref returns hashes the more\nimportant feature?\n\nThere was a lot of \"ambiguous refs\" discussion in the follow-up for\n\n  http://thread.gmane.org/gmane.comp.version-control.git/165885\n  Subject: [1.8.0] Provide proper remote ref namespaces\n\nFor example:\n\nOn Mon, Feb 07, 2011 at 03:25:51PM -0500, Jeff King wrote:\n> Will the same apply to refs/heads/foo versus refs/remotes/*/foo? Will it\n> also apply to refs/heads/foo versus refs/remotes/*/tags/foo? In the\n> final case, that does matter to \"git push\" (should the destination be in\n> the head or tag namespace?). So the actual names of the ref can matter,\n> and should probably be taken into account when deciding what is\n> ambiguous.\n\nSo it seems like having a way to figure out how Git is interpreting a\nshorthand ref would be useful, especially while those of us with less\nexperience are learning to think like Git.\n\nThe expansion command doesn't have to be notes-specific, but since the\ncurrent ref expansion is role specific (e.g. branch/tag/note/…), it\nseemed like the best place to put it.  With more consistent ref\ninterpretation, I'd be less interested in this expansion command ;).\n\nTrevor\n\n-- \nThis email may be signed or encrypted with GnuPG (http://www.gnupg.org).\nFor more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\n"},{"id":"198472","messageId":"7vr4qf2atd.fsf@alter.siamese.dyndns.org","threadId":"31447","inReplyTo":"20120906061147.GA11770@odin.tremily.us","subject":"Re: [PATCH 1/2] notes get-ref: --expand expands the output notes ref.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-06T19:47:10Z","receivedAt":"2012-09-06T19:47:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"W. Trevor King\" <wking@tremily.us> writes:\n\n> On Wed, Sep 05, 2012 at 10:23:54PM -0700, Junio C Hamano wrote:\n>> Really?  Would \"git log --expand master\" be useful?\n>\n> I'm clearly not an expert on this, but isn't that what\n>\n>   git show-ref master\n>\n> is for?\n\nBut then can't you say the same against \"git notes get-ref --expand\"\nwith \"git show-ref refs/remotes/origin/notes/foobla\"?\n\nMy primary point is that I think it is a UI mistake if the DWIM\nignores the user input that directly names that can be interpreted\nwithout DWIMming.  When the user wants to avoid ambiguity, it should\nalways be possible to spell it out without having to worry about the\nDWIM code to get in the way.\n\nThe problem with the current notes.c:expand_notes_ref() is that it\ndoes not allow you to do that, and if you fixed that problem, the\nuser never has to ask \"what does this expand to\", no?\n\nPerhaps something like this.  Note that this only deals with an\nexisting ref, and that is semi-deliberate (because I am not yet\nconvinced that it is a good idea to let any ref outside refs/notes/\nto be created to hold a notes tree).\n\n notes.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git i/notes.c w/notes.c\nindex 93e9868..126839e 100644\n--- i/notes.c\n+++ w/notes.c\n@@ -1289,6 +1289,8 @@ int copy_note(struct notes_tree *t,\n \n void expand_notes_ref(struct strbuf *sb)\n {\n+\tif (!prefixcmp(sb->buf, \"refs/\") && ref_exists(sb->buf))\n+\t\treturn;\n \tif (!prefixcmp(sb->buf, \"refs/notes/\"))\n \t\treturn; /* we're happy */\n \telse if (!prefixcmp(sb->buf, \"notes/\"))\n"},{"id":"198722","messageId":"CALKQrgen5r-VPp2mX7Yyiudx2+n1b_oK6iF57SWQ0o394Lm+Fg@mail.gmail.com","threadId":"31447","inReplyTo":"7vr4qf2atd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] notes get-ref: --expand expands the output notes ref.","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2012-09-10T20:21:09Z","receivedAt":"2012-09-10T20:21:09Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thu, Sep 6, 2012 at 9:47 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"W. Trevor King\" <wking@tremily.us> writes:\n>> On Wed, Sep 05, 2012 at 10:23:54PM -0700, Junio C Hamano wrote:\n>>> Really?  Would \"git log --expand master\" be useful?\n>>\n>> I'm clearly not an expert on this, but isn't that what\n>>\n>>   git show-ref master\n>>\n>> is for?\n>\n> But then can't you say the same against \"git notes get-ref --expand\"\n> with \"git show-ref refs/remotes/origin/notes/foobla\"?\n>\n> My primary point is that I think it is a UI mistake if the DWIM\n> ignores the user input that directly names that can be interpreted\n> without DWIMming.  When the user wants to avoid ambiguity, it should\n> always be possible to spell it out without having to worry about the\n> DWIM code to get in the way.\n>\n> The problem with the current notes.c:expand_notes_ref() is that it\n> does not allow you to do that, and if you fixed that problem, the\n> user never has to ask \"what does this expand to\", no?\n>\n> Perhaps something like this.  Note that this only deals with an\n> existing ref, and that is semi-deliberate (because I am not yet\n> convinced that it is a good idea to let any ref outside refs/notes/\n> to be created to hold a notes tree).\n\n(sorry for the late reply; I was away this weekend)\n\nThis patch looks like an acceptable solution to me. Especially since\nit prevents the notes code from \"accidentally\" creating new notes\ntrees outside refs/notes/*.\n\nThat said, we should check for more cases of hardcoded \"refs/notes/\"\nthat potentially needs changing as well.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}