From: "John Cai via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Eric Sunshine <sunshine@sunshineco.com>,
John Cai <johncai86@gmail.com>, John Cai <johncai86@gmail.com>
Subject: [PATCH v3] name-rev: make --stdin hidden
Date: Sat, 06 May 2023 04:14:11 +0000 [thread overview]
Message-ID: <pull.1225.v3.git.git.1683346451239.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1225.v2.git.git.1683314270964.gitgitgadget@gmail.com>
From: John Cai <johncai86@gmail.com>
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>
---
name-rev: make --stdin hidden
Now that --stdin has been deprecated for several releases, the next step
of replacing name-rev --stdin with --annotate-stdin is to make --stdin
hidden. This patch also updates documentation to get rid of any mention
of --stdin.
Changes since v2:
* Added a reference to --stdin in the docs
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1225%2Fjohn-cai%2Fjc%2Fhide-name-rev-stdin-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1225/john-cai/jc/hide-name-rev-stdin-v3
Pull-Request: https://github.com/git/git/pull/1225
Range-diff vs v2:
1: 904cd2c3572 ! 1: dbba7c4373b name-rev: make --stdin hidden
@@ Documentation/git-name-rev.txt: SYNOPSIS
DESCRIPTION
-----------
+@@ Documentation/git-name-rev.txt: 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:
+ +
@@ Documentation/git-name-rev.txt: The full name after substitution is master,
while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
-----------
Documentation/git-name-rev.txt | 11 ++++-------
builtin/name-rev.c | 6 +++++-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt
index ec8a27ce8bf..5c56c870253 100644
--- a/Documentation/git-name-rev.txt
+++ b/Documentation/git-name-rev.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git name-rev' [--tags] [--refs=<pattern>]
- ( --all | --stdin | <commit-ish>... )
+ ( --all | --annotate-stdin | <commit-ish>... )
DESCRIPTION
-----------
@@ -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:
+
@@ -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
@@ -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
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 593f0506a10..4d15a23fc4d 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -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,
base-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8
--
gitgitgadget
next prev parent reply other threads:[~2023-05-06 4:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 21:24 [PATCH] name-rev: make --stdin hidden John Cai via GitGitGadget
2022-03-09 18:55 ` Junio C Hamano
2022-03-09 19:20 ` John Cai
2023-05-05 19:17 ` [PATCH v2] " John Cai via GitGitGadget
2023-05-05 19:31 ` Eric Sunshine
2023-05-05 19:37 ` Junio C Hamano
2023-05-05 21:42 ` John Cai
2023-05-06 4:14 ` John Cai via GitGitGadget [this message]
2023-05-06 12:37 ` Teng Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.1225.v3.git.git.1683346451239.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=johncai86@gmail.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).