]> Kevux Git Server - rit/commitdiff
builtin/for-each-ref: align usage string with the man page
authorMeet Soni <meetsoni3017@gmail.com>
Tue, 5 Aug 2025 09:27:54 +0000 (14:57 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Aug 2025 16:11:54 +0000 (09:11 -0700)
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>
builtin/for-each-ref.c
t/t0450/adoc-help-mismatches

index 8b5fe7b..fe62f07 100644 (file)
@@ -9,12 +9,17 @@
 #include "strbuf.h"
 #include "strvec.h"
 
+#define COMMON_USAGE_FOR_EACH_REF \
+       "[--count=<count>] [--shell|--perl|--python|--tcl]\n" \
+       "                         [(--sort=<key>)...] [--format=<format>]\n" \
+       "                         [--include-root-refs] [--points-at=<object>]\n" \
+       "                         [--merged[=<object>]] [--no-merged[=<object>]]\n" \
+       "                         [--contains[=<object>]] [--no-contains[=<object>]]\n" \
+       "                         [(--exclude=<pattern>)...] [--start-after=<marker>]\n" \
+       "                         [ --stdin | <pattern>... ]"
+
 static char const * const for_each_ref_usage[] = {
-       N_("git for-each-ref [<options>] [<pattern>]"),
-       N_("git for-each-ref [--points-at <object>]"),
-       N_("git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"),
-       N_("git for-each-ref [--contains [<commit>]] [--no-contains [<commit>]]"),
-       N_("git for-each-ref [--start-after <marker>]"),
+       "git for-each-ref " COMMON_USAGE_FOR_EACH_REF,
        NULL
 };
 
index 06b469b..2c6ecd5 100644 (file)
@@ -17,7 +17,6 @@ fast-export
 fast-import
 fetch-pack
 fmt-merge-msg
-for-each-ref
 format-patch
 fsck-objects
 fsmonitor--daemon