Skip to content

Commit 69c207d

Browse files
inosmeetgitster
authored andcommitted
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 <[email protected]> Mentored-by: shejialuo <[email protected]> Mentored-by: Karthik Nayak <[email protected]> Signed-off-by: Meet Soni <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 19623eb commit 69c207d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

builtin/for-each-ref.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
#include "strbuf.h"
1010
#include "strvec.h"
1111

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+
1221
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,
1823
NULL
1924
};
2025

t/t0450/adoc-help-mismatches

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ fast-export
1717
fast-import
1818
fetch-pack
1919
fmt-merge-msg
20-
for-each-ref
2120
format-patch
2221
fsck-objects
2322
fsmonitor--daemon

0 commit comments

Comments
 (0)