From: Junio C Hamano Date: Thu, 30 Jul 2026 17:44:37 +0000 (-0700) Subject: Merge branch 'cc/fast-import-usage' into seen X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be18a87284d39f3cc94e6aec6bd926af16f883f3;p=thirdparty%2Fgit.git Merge branch 'cc/fast-import-usage' into seen The usage string of 'git fast-import' has been updated to use the parse_options() API for displaying help, and its SYNOPSIS in the documentation has been standardized to match. * cc/fast-import-usage: fast-import: use struct option for usage string fast-import: move command state globals into 'struct fast_import_state' fast-import: introduce 'struct fast_import_state' fast-import: localize 'i' into the 'for' loops using it api-parse-options.adoc: document hidden and OPT_*_F option macros api-parse-options.adoc: document per-option flags parse-options: introduce OPT_HIDDEN_GROUP --- be18a87284d39f3cc94e6aec6bd926af16f883f3 diff --cc t/t0040-parse-options.sh index a22533f9ed,4040333185..449fff4d34 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@@ -67,12 -70,32 +70,32 @@@ Alia EOF + cat >expect-noop <<\EOF + --[no-]obsolete no-op (backward compatibility) + EOF + + cat >expect-hidden <<\EOF + Hidden options + --[no-]hidden-bool get a boolean + -k, --[no-]hidden-integer + get a integer + + EOF + test_expect_success 'test help' ' + cat expect-part1 expect-part2 >expect && - test_must_fail test-tool parse-options -h >output 2>output.err && + test-tool parse-options -h >output 2>output.err && test_must_be_empty output.err && test_cmp expect output ' + test_expect_success 'test --help-all shows hidden group and options' ' + cat expect-part1 expect-noop expect-part2 expect-hidden >expect-help-all && - test_must_fail test-tool parse-options --help-all >output 2>output.err && ++ test-tool parse-options --help-all >output 2>output.err && + test_must_be_empty output.err && + test_cmp expect-help-all output + ' + mv expect expect.err check () { diff --cc t/t0450/adoc-help-mismatches index c4a55ff4e3,85b039a4be..baf3b1d809 --- a/t/t0450/adoc-help-mismatches +++ b/t/t0450/adoc-help-mismatches @@@ -12,7 -12,7 +12,6 @@@ colum credential credential-cache credential-store - fast-import -fast-export fetch-pack fmt-merge-msg format-patch