Skip to content

Commit a5e8e3e

Browse files
committed
name-rev: remove "--stdin" support
As part of Git 3.0, remove the hidden synonym for "--annotate-stdin" for real. As this does not change the fact that it used to be called "--stdin" in older version of Git, keep that passage in the documentation for "--annotate-stdin". Signed-off-by: Junio C Hamano <[email protected]>
1 parent c4b4dfb commit a5e8e3e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Documentation/BreakingChanges.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ references.
178178
+
179179
These features will be removed.
180180

181+
* Support for "--stdin" option in the "name-rev" command was
182+
deprecated (and hidden from the documentation) in the Git 2.40
183+
timeframe, in preference to its synonym "--annotate-stdin". Git 3.0
184+
removes the support for "--stdin" altogether.
185+
186+
181187
== Superseded features that will not be deprecated
182188

183189
Some features have gained newer replacements that aim to improve the design in

builtin/name-rev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,13 @@ int cmd_name_rev(int argc,
578578
N_("ignore refs matching <pattern>")),
579579
OPT_GROUP(""),
580580
OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
581+
#ifndef WITH_BREAKING_CHANGES
581582
OPT_BOOL_F(0,
582583
"stdin",
583584
&transform_stdin,
584585
N_("deprecated: use --annotate-stdin instead"),
585586
PARSE_OPT_HIDDEN),
587+
#endif /* WITH_BREAKING_CHANGES */
586588
OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
587589
OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
588590
OPT_BOOL(0, "always", &always,

t/t6120-describe.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,14 @@ test_expect_success 'name-rev --annotate-stdin' '
300300

301301
test_expect_success 'name-rev --stdin deprecated' '
302302
git rev-list --all >list &&
303-
git name-rev --stdin <list 2>actual &&
304-
test_grep "warning: --stdin is deprecated" actual
303+
if ! test_have_prereq WITH_BREAKING_CHANGES
304+
then
305+
git name-rev --stdin <list 2>actual &&
306+
test_grep "warning: --stdin is deprecated" actual
307+
else
308+
test_must_fail git name-rev --stdin <list 2>actual &&
309+
test_grep "unknown option .stdin." actual
310+
fi
305311
'
306312

307313
test_expect_success 'describe --contains with the exact tags' '

0 commit comments

Comments
 (0)