{"thread":{"id":"40407","subject":"[PATCH v2] notes: correct documentation of DWIMery for notes references","startedAt":"2015-09-22T22:15:03Z","lastAt":"2015-09-22T22:15:03Z","messageCount":1,"participants":["Jacob Keller"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"270538","messageId":"1442960103-22515-1-git-send-email-jacob.e.keller@intel.com","threadId":"40407","inReplyTo":null,"subject":"[PATCH v2] notes: correct documentation of DWIMery for notes references","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2015-09-22T22:15:03Z","receivedAt":"2015-09-22T22:15:03Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Jacob Keller <jacob.keller@gmail.com>\n\nexpand_notes_ref is used by --ref from git-notes(1) and --notes from the\ngit log to find the full refname of a notes reference. Previously the\ndocumentation of these options was not clear about what sorts of\nexpansions would be performed. Fix the documentation to clearly and\naccurately describe the behavior of the expansions.\n\nAdd a test for this expansion when using git notes get-ref in order to\nprevent future patches from changing this behavior.\n\nSigned-off-by: Jacob Keller <jacob.keller@gmail.com>\n---\n Documentation/git-notes.txt      | 4 +++-\n Documentation/pretty-options.txt | 5 +++--\n t/t3301-notes.sh                 | 6 ++++++\n 3 files changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt\nindex a9a916f360ec..8de349968a3b 100644\n--- a/Documentation/git-notes.txt\n+++ b/Documentation/git-notes.txt\n@@ -162,7 +162,9 @@ OPTIONS\n --ref <ref>::\n \tManipulate the notes tree in <ref>.  This overrides\n \t'GIT_NOTES_REF' and the \"core.notesRef\" configuration.  The ref\n-\tis taken to be in `refs/notes/` if it is not qualified.\n+\tspecifies the full refname when it begins with `refs/notes/`; when it\n+\tbegins with `notes/`, `refs/` and otherwise `refs/notes/` is prefixed\n+\tto form a full name of the ref.\n \n --ignore-missing::\n \tDo not consider it an error to request removing notes from an\ndiff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\nindex 8d6c5cec4c5e..4b659ac1a6a6 100644\n--- a/Documentation/pretty-options.txt\n+++ b/Documentation/pretty-options.txt\n@@ -55,8 +55,9 @@ By default, the notes shown are from the notes refs listed in the\n environment overrides). See linkgit:git-config[1] for more details.\n +\n With an optional '<ref>' argument, show this notes ref instead of the\n-default notes ref(s). The ref is taken to be in `refs/notes/` if it\n-is not qualified.\n+default notes ref(s). The ref specifies the full refname when it begins\n+with `refs/notes/`; when it begins with `notes/`, `refs/` and otherwise\n+`refs/notes/` is prefixed to form a full name of the ref.\n +\n Multiple --notes options can be combined to control which notes are\n being displayed. Examples: \"--notes=foo\" will show only notes from\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex 06b45847c147..2d200fdf36c6 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -1132,6 +1132,12 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '\n \ttest_must_fail git notes copy one two three\n '\n \n+test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '\n+\ttest_unconfig core.notesRef &&\n+\tsane_unset GIT_NOTES_REF &&\n+\ttest \"$(git notes --ref=refs/heads/master get-ref)\" = \"refs/notes/refs/heads/master\"\n+'\n+\n test_expect_success 'git notes get-ref (no overrides)' '\n \ttest_unconfig core.notesRef &&\n \tsane_unset GIT_NOTES_REF &&\n-- \n2.6.0.rc3.238.gc07a1e8\n"}]}