Skip to content

Commit

Permalink
Merge branch 'jk/notes-dwim-doc' into maint
Browse files Browse the repository at this point in the history
The way how --ref/--notes to specify the notes tree reference are
DWIMmed was not clearly documented.

* jk/notes-dwim-doc:
  notes: correct documentation of DWIMery for notes references
  • Loading branch information
Junio C Hamano committed Oct 16, 2015
2 parents 47c566a + e14c92e commit f4892a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Documentation/git-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ OPTIONS
--ref <ref>::
Manipulate the notes tree in <ref>. This overrides
'GIT_NOTES_REF' and the "core.notesRef" configuration. The ref
is taken to be in `refs/notes/` if it is not qualified.
specifies the full refname when it begins with `refs/notes/`; when it
begins with `notes/`, `refs/` and otherwise `refs/notes/` is prefixed
to form a full name of the ref.

--ignore-missing::
Do not consider it an error to request removing notes from an
Expand Down
5 changes: 3 additions & 2 deletions Documentation/pretty-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ By default, the notes shown are from the notes refs listed in the
environment overrides). See linkgit:git-config[1] for more details.
+
With an optional '<ref>' argument, show this notes ref instead of the
default notes ref(s). The ref is taken to be in `refs/notes/` if it
is not qualified.
default notes ref(s). The ref specifies the full refname when it begins
with `refs/notes/`; when it begins with `notes/`, `refs/` and otherwise
`refs/notes/` is prefixed to form a full name of the ref.
+
Multiple --notes options can be combined to control which notes are
being displayed. Examples: "--notes=foo" will show only notes from
Expand Down
6 changes: 6 additions & 0 deletions t/t3301-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,12 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
test_must_fail git notes copy one two three
'

test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '
test_unconfig core.notesRef &&
sane_unset GIT_NOTES_REF &&
test "$(git notes --ref=refs/heads/master get-ref)" = "refs/notes/refs/heads/master"
'

test_expect_success 'git notes get-ref (no overrides)' '
test_unconfig core.notesRef &&
sane_unset GIT_NOTES_REF &&
Expand Down

0 comments on commit f4892a3

Please sign in to comment.