Skip to content

Commit

Permalink
Merge branch 'jc/name-rev-deprecate-stdin-further'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed May 15, 2023
2 parents 3fb8a0f + 9019d7d commit be2fd0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Documentation/git-name-rev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git name-rev' [--tags] [--refs=<pattern>]
( --all | --stdin | <commit-ish>... )
( --all | --annotate-stdin | <commit-ish>... )

DESCRIPTION
-----------
Expand Down Expand Up @@ -46,7 +46,8 @@ OPTIONS
Transform stdin by substituting all the 40-character SHA-1
hexes (say $hex) with "$hex ($rev_name)". When used with
--name-only, substitute with "$rev_name", omitting $hex
altogether.
altogether. This option was called `--stdin` in older versions
of Git.
+
For example:
+
Expand All @@ -70,10 +71,6 @@ The full name after substitution is master,
while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
-----------

--stdin::
This option is deprecated in favor of 'git name-rev --annotate-stdin'.
They are functionally equivalent.

--name-only::
Instead of printing both the SHA-1 and the name, print only
the name. If given with --tags the usual tag prefix of
Expand Down Expand Up @@ -107,7 +104,7 @@ Now you are wiser, because you know that it happened 940 revisions before v0.99.
Another nice thing you can do is:

------------
% git log | git name-rev --stdin
% git log | git name-rev --annotate-stdin
------------

GIT
Expand Down
6 changes: 5 additions & 1 deletion builtin/name-rev.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,11 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
N_("ignore refs matching <pattern>")),
OPT_GROUP(""),
OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
OPT_BOOL(0, "stdin", &transform_stdin, N_("deprecated: use --annotate-stdin instead")),
OPT_BOOL_F(0,
"stdin",
&transform_stdin,
N_("deprecated: use --annotate-stdin instead"),
PARSE_OPT_HIDDEN),
OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
OPT_BOOL(0, "always", &always,
Expand Down

0 comments on commit be2fd0e

Please sign in to comment.