builtin/for-each-ref: align usage string with the man page
Usage string for `git for-each-ref` was out of sync with its official documentation. The test `t0450-txt-doc-vs-help.sh` was marked as broken due to this. Update the usage string to match the documentation. This allows the test to pass, so remove the corresponding 'known breakage' marker from the test file. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: shejialuo <shejialuo@gmail.com> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Meet Soni <meetsoni3017@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Meet Soni committed
Aug 5, 2025 at 14:57 UTC
69c207dc45c0e95bff2bdcaf1c7aca41e9679fb8
2 files changed
+10
-6
builtin/for-each-ref.c
+10
-5
@@ -9,12 +9,17 @@
9
#include "strbuf.h"
10
#include "strvec.h"
11
12
+#define COMMON_USAGE_FOR_EACH_REF \
13
+ "[--count=<count>] [--shell|--perl|--python|--tcl]\n" \
14
+ " [(--sort=<key>)...] [--format=<format>]\n" \
15
+ " [--include-root-refs] [--points-at=<object>]\n" \
16
+ " [--merged[=<object>]] [--no-merged[=<object>]]\n" \
17
+ " [--contains[=<object>]] [--no-contains[=<object>]]\n" \
18
+ " [(--exclude=<pattern>)...] [--start-after=<marker>]\n" \
19
+ " [ --stdin | <pattern>... ]"
20
+
21
static char const * const for_each_ref_usage[] = {
13
- N_("git for-each-ref [<options>] [<pattern>]"),
14
- N_("git for-each-ref [--points-at <object>]"),
15
- N_("git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"),
16
- N_("git for-each-ref [--contains [<commit>]] [--no-contains [<commit>]]"),
17
- N_("git for-each-ref [--start-after <marker>]"),
22
+ "git for-each-ref " COMMON_USAGE_FOR_EACH_REF,
23
NULL
24
};
25
t/t0450/adoc-help-mismatches
-1
@@ -17,7 +17,6 @@ fast-export
17
fast-import
18
fetch-pack
19
fmt-merge-msg
20
-for-each-ref
20
format-patch
21
fsck-objects
22
fsmonitor--daemon