rev-list: make it obvious that we do not support notes

The rev-list command does not have the internal infrastructure to display notes. Running: git rev-list --notes HEAD will silently ignore the "--notes" option. Running: git rev-list --notes --grep=. HEAD will crash on an assert. Running: git rev-list --format=%N HEAD will place a literal "%N" in the output (it does not even expand to an empty string). Let's have rev-list tell the user that it cannot fill the user's request, rather than silently producing wrong data. Likewise, let's remove mention of the notes options from the rev-list documentation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 23, 2015 at 13:56 UTC 2aea7a51a11598427d5b57e4bc042930d592547f
4 files changed +9
Documentation/pretty-formats.txt
+2
@@ -139,7 +139,9 @@ The placeholders are:
139 - '%f': sanitized subject line, suitable for a filename
140 - '%b': body
141 - '%B': raw body (unwrapped subject and body)
142 +ifndef::git-rev-list[]
143 - '%N': commit notes
144 +endif::git-rev-list[]
145 - '%GG': raw verification message from GPG for a signed commit
146 - '%G?': show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
147 untrusted signature and "N" for no signature
Documentation/pretty-options.txt
+2
@@ -42,6 +42,7 @@ people using 80-column terminals.
42 verbatim; this means that invalid sequences in the original
43 commit may be copied to the output.
44
45 +ifndef::git-rev-list[]
46 --notes[=<ref>]::
47 Show the notes (see linkgit:git-notes[1]) that annotate the
48 commit, when showing the commit log message. This is the default
@@ -73,6 +74,7 @@ being displayed. Examples: "--notes=foo" will show only notes from
74 --[no-]standard-notes::
75 These options are deprecated. Use the above --notes/--no-notes
76 options instead.
77 +endif::git-rev-list[]
78
79 --show-signature::
80 Check the validity of a signed commit object by passing the signature
Documentation/rev-list-options.txt
+2
@@ -58,9 +58,11 @@ endif::git-rev-list[]
58 more than one `--grep=<pattern>`, commits whose message
59 matches any of the given patterns are chosen (but see
60 `--all-match`).
61 +ifndef::git-rev-list[]
62 +
63 When `--show-notes` is in effect, the message from the notes is
64 matched as if it were part of the log message.
65 +endif::git-rev-list[]
66
67 --all-match::
68 Limit the commits output to ones that match all given `--grep`,
builtin/rev-list.c
+3
@@ -350,6 +350,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
350 revs.diff)
351 usage(rev_list_usage);
352
353 + if (revs.show_notes)
354 + die(_("rev-list does not support display of notes"));
355 +
356 save_commit_buffer = (revs.verbose_header ||
357 revs.grep_filter.pattern_list ||
358 revs.grep_filter.header_list);