]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rev-list: make it obvious that we do not support notes
authorJeff King <peff@peff.net>
Sun, 23 Aug 2015 17:56:40 +0000 (13:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Aug 2015 17:33:15 +0000 (10:33 -0700)
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>
Documentation/pretty-formats.txt
Documentation/pretty-options.txt
Documentation/rev-list-options.txt
builtin/rev-list.c

index dc865cbb2766004089f6bf49bca2638ed6f693d9..671cebd95c36f2dc6e17fb599219e305a567bc55 100644 (file)
@@ -139,7 +139,9 @@ The placeholders are:
 - '%f': sanitized subject line, suitable for a filename
 - '%b': body
 - '%B': raw body (unwrapped subject and body)
+ifndef::git-rev-list[]
 - '%N': commit notes
+endif::git-rev-list[]
 - '%GG': raw verification message from GPG for a signed commit
 - '%G?': show "G" for a Good signature, "B" for a Bad signature, "U" for a good,
   untrusted signature and "N" for no signature
index 642af6e42684602f5465fc3c61d83ca6309b34cb..8d6c5cec4c5edc904a5f2d7595fd8943457f550d 100644 (file)
@@ -42,6 +42,7 @@ people using 80-column terminals.
        verbatim; this means that invalid sequences in the original
        commit may be copied to the output.
 
+ifndef::git-rev-list[]
 --notes[=<ref>]::
        Show the notes (see linkgit:git-notes[1]) that annotate the
        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
 --[no-]standard-notes::
        These options are deprecated. Use the above --notes/--no-notes
        options instead.
+endif::git-rev-list[]
 
 --show-signature::
        Check the validity of a signed commit object by passing the signature
index 77ac439234f40f51aae8613a672de06e3e143771..31bee069aa90d2f1c12f709c5e60e71ce4ffa199 100644 (file)
@@ -58,9 +58,11 @@ endif::git-rev-list[]
        more than one `--grep=<pattern>`, commits whose message
        matches any of the given patterns are chosen (but see
        `--all-match`).
+ifndef::git-rev-list[]
 +
 When `--show-notes` is in effect, the message from the notes is
 matched as if it were part of the log message.
+endif::git-rev-list[]
 
 --all-match::
        Limit the commits output to ones that match all given `--grep`,
index c0b4b53652a39049ec06ba69f2dfc50a8c0873f7..d80d1ed35944144aa0aeeeb1b0e08c9efdec6523 100644 (file)
@@ -350,6 +350,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
            revs.diff)
                usage(rev_list_usage);
 
+       if (revs.show_notes)
+               die(_("rev-list does not support display of notes"));
+
        save_commit_buffer = (revs.verbose_header ||
                              revs.grep_filter.pattern_list ||
                              revs.grep_filter.header_list);