]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'cc/fast-import-usage' into seen
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:44:37 +0000 (10:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:44:37 +0000 (10:44 -0700)
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

1  2 
builtin/fast-import.c
parse-options.c
parse-options.h
t/t0040-parse-options.sh
t/t0450/adoc-help-mismatches

Simple merge
diff --cc parse-options.c
Simple merge
diff --cc parse-options.h
Simple merge
index a22533f9ed6d160b3a1a31705be2325cefe61501,4040333185b22283fcc7146c750c5995fe8b9bad..449fff4d34b1723c111211a8d18d994198f9a59e
@@@ -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 <n>
+                           get a integer
+ EOF
  test_expect_success 'test help' '
 -      test_must_fail test-tool parse-options -h >output 2>output.err &&
+       cat expect-part1 expect-part2 >expect &&
 +      test-tool parse-options -h >output 2>output.err &&
        test_must_be_empty output.err &&
        test_cmp expect output
  '
  
 -      test_must_fail test-tool parse-options --help-all >output 2>output.err &&
+ test_expect_success 'test --help-all shows hidden group and options' '
+       cat expect-part1 expect-noop expect-part2 expect-hidden >expect-help-all &&
++      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 () {
index c4a55ff4e35a4fa54ddf0087961d24f58a9a6bfc,85b039a4be3c839b2ac261220a81cff2ebf6d0a6..baf3b1d80927d45738d6fe7e5421140634b88ec0
@@@ -12,7 -12,7 +12,6 @@@ colum
  credential
  credential-cache
  credential-store
- fast-import
 -fast-export
  fetch-pack
  fmt-merge-msg
  format-patch