name-rev: make --stdin hidden

In 34ae3b70 (name-rev: deprecate --stdin in favor of --annotate-stdin), we renamed --stdin to --annotate-stdin for the sake of a clearer name for the option, and added text that indicates --stdin is deprecated. The next step is to hide --stdin completely. Make the option hidden. Also, update documentation to remove all mentions of --stdin. Signed-off-by: "John Cai" <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Cai committed May 6, 2023 at 04:14 UTC 9019d7dceb85bd821a32930c49a4675015bcc283
2 files changed +9 -8
Documentation/git-name-rev.txt
+4 -7
@@ -10,7 +10,7 @@ SYNOPSIS
10 --------
11 [verse]
12 'git name-rev' [--tags] [--refs=<pattern>]
13 - ( --all | --stdin | <commit-ish>... )
13 + ( --all | --annotate-stdin | <commit-ish>... )
14
15 DESCRIPTION
16 -----------
@@ -46,7 +46,8 @@ OPTIONS
46 Transform stdin by substituting all the 40-character SHA-1
47 hexes (say $hex) with "$hex ($rev_name)". When used with
48 --name-only, substitute with "$rev_name", omitting $hex
49 - altogether.
49 + altogether. This option was called `--stdin` in older versions
50 + of Git.
51 +
52 For example:
53 +
@@ -70,10 +71,6 @@ The full name after substitution is master,
71 while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
72 -----------
73
73 ---stdin::
74 - This option is deprecated in favor of 'git name-rev --annotate-stdin'.
75 - They are functionally equivalent.
76 -
74 --name-only::
75 Instead of printing both the SHA-1 and the name, print only
76 the name. If given with --tags the usual tag prefix of
@@ -107,7 +104,7 @@ Now you are wiser, because you know that it happened 940 revisions before v0.99.
104 Another nice thing you can do is:
105
106 ------------
110 -% git log | git name-rev --stdin
107 +% git log | git name-rev --annotate-stdin
108 ------------
109
110 GIT
builtin/name-rev.c
+5 -1
@@ -573,7 +573,11 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
573 N_("ignore refs matching <pattern>")),
574 OPT_GROUP(""),
575 OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
576 - OPT_BOOL(0, "stdin", &transform_stdin, N_("deprecated: use --annotate-stdin instead")),
576 + OPT_BOOL_F(0,
577 + "stdin",
578 + &transform_stdin,
579 + N_("deprecated: use --annotate-stdin instead"),
580 + PARSE_OPT_HIDDEN),
581 OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
582 OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
583 OPT_BOOL(0, "always", &always,