Skip to content

Commit be2fd0e

Browse files
committed
Merge branch 'jc/name-rev-deprecate-stdin-further'
The "--stdin" option of "git name-rev" has been replaced with the "--annotate-stdin" option more than a year ago. We stop advertising it in the "git name-rev -h" output. * jc/name-rev-deprecate-stdin-further: name-rev: make --stdin hidden
2 parents 3fb8a0f + 9019d7d commit be2fd0e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Documentation/git-name-rev.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git name-rev' [--tags] [--refs=<pattern>]
13-
( --all | --stdin | <commit-ish>... )
13+
( --all | --annotate-stdin | <commit-ish>... )
1414

1515
DESCRIPTION
1616
-----------
@@ -46,7 +46,8 @@ OPTIONS
4646
Transform stdin by substituting all the 40-character SHA-1
4747
hexes (say $hex) with "$hex ($rev_name)". When used with
4848
--name-only, substitute with "$rev_name", omitting $hex
49-
altogether.
49+
altogether. This option was called `--stdin` in older versions
50+
of Git.
5051
+
5152
For example:
5253
+
@@ -70,10 +71,6 @@ The full name after substitution is master,
7071
while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
7172
-----------
7273

73-
--stdin::
74-
This option is deprecated in favor of 'git name-rev --annotate-stdin'.
75-
They are functionally equivalent.
76-
7774
--name-only::
7875
Instead of printing both the SHA-1 and the name, print only
7976
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.
107104
Another nice thing you can do is:
108105

109106
------------
110-
% git log | git name-rev --stdin
107+
% git log | git name-rev --annotate-stdin
111108
------------
112109

113110
GIT

builtin/name-rev.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,11 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
573573
N_("ignore refs matching <pattern>")),
574574
OPT_GROUP(""),
575575
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),
577581
OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
578582
OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
579583
OPT_BOOL(0, "always", &always,

0 commit comments

Comments
 (0)