From 69c207dc45c0e95bff2bdcaf1c7aca41e9679fb8 Mon Sep 17 00:00:00 2001 From: Meet Soni Date: Tue, 5 Aug 2025 14:57:54 +0530 Subject: [PATCH] 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 Mentored-by: shejialuo Mentored-by: Karthik Nayak Signed-off-by: Meet Soni Signed-off-by: Junio C Hamano --- builtin/for-each-ref.c | 15 ++++++++++----- t/t0450/adoc-help-mismatches | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index 8b5fe7b65e..fe62f07861 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -9,12 +9,17 @@ #include "strbuf.h" #include "strvec.h" +#define COMMON_USAGE_FOR_EACH_REF \ + "[--count=] [--shell|--perl|--python|--tcl]\n" \ + " [(--sort=)...] [--format=]\n" \ + " [--include-root-refs] [--points-at=]\n" \ + " [--merged[=]] [--no-merged[=]]\n" \ + " [--contains[=]] [--no-contains[=]]\n" \ + " [(--exclude=)...] [--start-after=]\n" \ + " [ --stdin | ... ]" + static char const * const for_each_ref_usage[] = { - N_("git for-each-ref [] []"), - N_("git for-each-ref [--points-at ]"), - N_("git for-each-ref [--merged []] [--no-merged []]"), - N_("git for-each-ref [--contains []] [--no-contains []]"), - N_("git for-each-ref [--start-after ]"), + "git for-each-ref " COMMON_USAGE_FOR_EACH_REF, NULL }; diff --git a/t/t0450/adoc-help-mismatches b/t/t0450/adoc-help-mismatches index 06b469bdee..2c6ecd5fc8 100644 --- a/t/t0450/adoc-help-mismatches +++ b/t/t0450/adoc-help-mismatches @@ -17,7 +17,6 @@ fast-export fast-import fetch-pack fmt-merge-msg -for-each-ref format-patch fsck-objects fsmonitor--daemon -- 2.47.3