]> git.ipfire.org Git - thirdparty/git.git/commit
fast-import: use struct option for usage string
authorChristian Couder <christian.couder@gmail.com>
Thu, 16 Jul 2026 16:55:17 +0000 (18:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Jul 2026 21:11:13 +0000 (14:11 -0700)
commit84631f0695e08a298809da0cd3db1db0c07bdb35
treecb0324ac4142d21328158be52baca44524c58782
parentf254d37b89ff9c9d742ace65e852ef37b73540a0
fast-import: use struct option for usage string

Currently `git fast-import -h` shows the following on a single line:

  usageĀ : git fast-import [--date-format=<f>] [--max-pack-size=<n>] \
                          [--big-file-threshold=<n>] [--depth=<n>] \
                          [--active-branches=<n>] \
                          [--export-marks=<marks.file>]

This output has a number of issues like:

  - It's missing a lot of options.
  - It's not consistent with the SYNOPSIS section of the doc.
  - With `--help-all` instead of `-h` additional hidden options should
    be shown, but that's not the case.
  - It's not standard style anymore.
  - Most other Git commands show additional lines for most of the
    options they support.

Also while most commands use the parse-options API to handle their
options, "builtin/fast-import.c" still doesn't use it.

Let's improve on that by using the parse-options API to display the
options when `-h` and `--help-all` are used.

While at it, let's make the SYNOPSIS section of
"Documentation/git-fast-import.adoc" consistent with the new usage
string.

This deliberately leaves it to future work to also use the
parse-options API to actually parse the options.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.adoc
builtin/fast-import.c
t/t0450/adoc-help-mismatches