git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 00/12] fast-import: standardize usage string and SYNOPSIS

From
Elijah Newren <newren@gmail.com>
Date
Aug 12, 2026, 20:29 UTC
Message-ID
<CABPp-BH4MmEL5vZv7ZoUufT8quk4vCq==Ef_XAfxjj9U-WBsEw@mail.gmail.com>
In-Reply-To
<20260811083314.2023489-1-christian.couder@gmail.com>

On Tue, Aug 11, 2026 at 1:33 AM Christian Couder <christian.couder@gmail.com> wrote:

Show 38 quoted lines
>
> Changes since v2
> ================
>
> Thanks to Elijah for reviewing v2 and Junio for reviewing v1.
>
> The series has been rebased on top of recent master at 010afd3166 (The
> 12th batch, 2026-08-07).
>
>   - Patch 2/12 now describes `PARSE_OPT_LASTARG_DEFAULT` the way Elijah
>     suggested, which matches what "parse-options.h" says, and mentions
>     that it should not be combined with `PARSE_OPT_OPTARG`.
>
>   - Patch 7/12 now wraps the function signatures that grew too long
>     when they gained a 'struct fast_import_state *state' argument, with
>     one parameter per line. Patches 8/12 and 12/12 have been adjusted
>     accordingly, as they touch two of these signatures again.
>
>   - Patch 11/12 now also lists two other behavior changes that Elijah
>     spotted: value-taking options accept the space-separated
>     `--opt value` form, and a bare or trailing `--` is now accepted.
>
>   - Patch 11/12 also documents, both in a NEEDSWORK code comment and
>     in "Documentation/git-fast-import.adoc", the third behavior change
>     Elijah spotted about `--allow-unsafe-features`: as the early scan
>     for that option only matches its exact spelling and stops at the
>     first non-option argument, it disagrees with parse_options() for
>     command lines like `--allow-unsafe` or
>     `--depth 5 --allow-unsafe-features`. This errs on the safe side,
>     as unsafe `feature` commands from the stream are refused in that
>     case.
>
>     I plan to work on a follow-up series that will improve on this by
>     teaching the early scan about the options that take a value. It
>     looks like the parse-options API could provide some helpers for
>     this, which might benefit other commands like `git` itself (see
>     handle_options() in "git.c") that need to look at some options
>     before the actual option parsing.

Thanks, this version addresses all my feedback on the previous round, and I spotted no new issues introduced. Looks good to me.

Previous: Christian Couder
Message 48 of 48 in “fast-import: standardize usage string and SYNOPSIS”
  1. 0/7 fast-import: standardize usage string and SYNOPSISChristian Couder, Jul 16, 2026
  2. 1/7 parse-options: introduce OPT_HIDDEN_GROUPChristian Couder, Jul 16, 2026
  3. Junio C HamanoJul 16, 2026
  4. .mailmap etiquette (was "Re: [PATCH 1/7] parse-options: introduce OPT_HIDDEN_GROUP")D. Ben Knoble, Jul 16, 2026
  5. Junio C HamanoJul 16, 2026
  6. Christian CouderAug 3, 2026
  7. 2/7 api-parse-options.adoc: document per-option flagsChristian Couder, Jul 16, 2026
  8. 3/7 api-parse-options.adoc: document hidden and OPT_*_F option macrosChristian Couder, Jul 16, 2026
  9. 4/7 fast-import: localize 'i' into the 'for' loops using itChristian Couder, Jul 16, 2026
  10. 5/7 fast-import: introduce 'struct fast_import_state'Christian Couder, Jul 16, 2026
  11. 6/7 fast-import: move command state globals into 'struct fast_import_state'Christian Couder, Jul 16, 2026
  12. 7/7 fast-import: use struct option for usage stringChristian Couder, Jul 16, 2026
  13. Junio C HamanoJul 16, 2026
  14. Christian CouderAug 3, 2026
  15. 00/12 fast-import: standardize usage string and SYNOPSISChristian Couder, Aug 4, 2026
  16. 01/12 parse-options: introduce OPT_HIDDEN_GROUPChristian Couder, Aug 4, 2026
  17. 02/12 api-parse-options.adoc: document per-option flagsChristian Couder, Aug 4, 2026
  18. Elijah NewrenAug 8, 2026
  19. Christian CouderAug 11, 2026
  20. 03/12 api-parse-options.adoc: document hidden and OPT_*_F option macrosChristian Couder, Aug 4, 2026
  21. 04/12 fast-import: localize 'i' into the 'for' loops using itChristian Couder, Aug 4, 2026
  22. 05/12 fast-import: use int for some bool flagsChristian Couder, Aug 4, 2026
  23. 06/12 fast-import: factor out option_*() functionsChristian Couder, Aug 4, 2026
  24. 07/12 fast-import: introduce 'struct fast_import_state'Christian Couder, Aug 4, 2026
  25. Elijah NewrenAug 8, 2026
  26. Christian CouderAug 11, 2026
  27. 08/12 fast-import: move command state globals into 'struct fast_import_state'Christian Couder, Aug 4, 2026
  28. 09/12 fast-import: use struct option for usage stringChristian Couder, Aug 4, 2026
  29. 10/12 fast-import: use callbacks to parse some optionsChristian Couder, Aug 4, 2026
  30. 11/12 fast-import: use parse_options() for command line optionsChristian Couder, Aug 4, 2026
  31. Elijah NewrenAug 8, 2026
  32. Christian CouderAug 11, 2026
  33. 12/12 fast-import: remove useless from_stream argumentChristian Couder, Aug 4, 2026
  34. Elijah NewrenAug 8, 2026
  35. 00/12 fast-import: standardize usage string and SYNOPSISChristian Couder, Aug 11, 2026
  36. 02/12 api-parse-options.adoc: document per-option flagsChristian Couder, Aug 11, 2026
  37. 03/12 api-parse-options.adoc: document hidden and OPT_*_F option macrosChristian Couder, Aug 11, 2026
  38. 04/12 fast-import: localize 'i' into the 'for' loops using itChristian Couder, Aug 11, 2026
  39. 05/12 fast-import: use int for some bool flagsChristian Couder, Aug 11, 2026
  40. 06/12 fast-import: factor out option_*() functionsChristian Couder, Aug 11, 2026
  41. 07/12 fast-import: introduce 'struct fast_import_state'Christian Couder, Aug 11, 2026
  42. 08/12 fast-import: move command state globals into 'struct fast_import_state'Christian Couder, Aug 11, 2026
  43. 09/12 fast-import: use struct option for usage stringChristian Couder, Aug 11, 2026
  44. 10/12 fast-import: use callbacks to parse some optionsChristian Couder, Aug 11, 2026
  45. 11/12 fast-import: use parse_options() for command line optionsChristian Couder, Aug 11, 2026
  46. 12/12 fast-import: remove useless from_stream argumentChristian Couder, Aug 11, 2026
  47. 01/12 parse-options: introduce OPT_HIDDEN_GROUPChristian Couder, Aug 11, 2026
  48. Elijah NewrenAug 12, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.