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

Re: [PATCH v4 0/4] Standardize early option scanning

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Nov 3, 2026, 07:54 UTC
Message-ID
<faf0b5e6-1c63-4c68-9f23-42a452879854@gmail.com>
In-Reply-To
<20261102151447.734680-6-christian.couder@gmail.com>
On 11/2/26 20:44, Christian Couder wrote:
Show 27 quoted lines
> Changes since v3
> ================
> > Thanks a lot to Junio, Kaartic and Cynthia who reviewed previous
> versions.
> > There are a number of small changes since v3:
> >   - In patch 2/4, a `switch` statement is now used in parse_long_opt()
>     to process the result from lookup_long_opt().
> >   - In patch 3/4, a parse_options_check() call has been added to
>     early_scan_options(), after aliases are preprocessed, so that the
>     options are checked before the scan relies on them, rather than
>     only later by parse_options().
> >   - In patch 3/4, in "parse-options.h":
> >     - the comment before early_scan_fn() has been improved to mention
>       that the `option` argument may point into a temporary copy of the
>       options, and
> >     - the end of the comment before early_scan_options() has been made
>       clearer and now mentions that EARLY_SCAN_STOP_AT_NON_OPTION is
>       safe to use even if PARSE_OPT_STOP_AT_NON_OPTION is not passed to
>       parse_options().
> >   - In patch 4/4:
> >     - the comment before the call to early_scan_options() in
>       cmd_fast_import() has been improved to explain why
>       EARLY_SCAN_STOP_AT_NON_OPTION is passed,
> >     - a new test has been added to check that unsafe "feature" commands
>       from the stream are refused when `--allow-unsafe-features` comes
>       after a non-option argument, which parse_argv() rejects anyway.
> Thanks! This version looks good to me!
-- 
Sivaraam
Previous: Christian CouderNext: Junio C Hamano
Message 40 of 41 in “Standardize early option scanning to fix argument parsing bugs”
  1. 0/6 Standardize early option scanning to fix argument parsing bugsChristian Couder, Sep 2, 2026
  2. 1/6 parse-options: add early_scan_options()Christian Couder, Sep 2, 2026
  3. Junio C HamanoSep 2, 2026
  4. Christian CouderSep 23, 2026
  5. Junio C HamanoSep 23, 2026
  6. 2/6 bisect: fix "--" detection when a term name is "--"Christian Couder, Sep 2, 2026
  7. Junio C HamanoSep 2, 2026
  8. Christian CouderSep 23, 2026
  9. Junio C HamanoSep 23, 2026
  10. 3/6 rev-parse: fix "--" detection when it is an option valueChristian Couder, Sep 2, 2026
  11. 4/6 parse-options: add parse_options_takes_argument()Christian Couder, Sep 2, 2026
  12. 5/6 parse-options: build early scan options from a struct option arrayChristian Couder, Sep 2, 2026
  13. 6/6 fast-import: use early_scan_options() for --allow-unsafe-featuresChristian Couder, Sep 2, 2026
  14. Junio C HamanoSep 4, 2026
  15. Junio C HamanoSep 2, 2026
  16. Christian CouderSep 23, 2026
  17. 0/3 Standardize early option scanningChristian Couder, Sep 23, 2026
  18. 1/3 parse-options: add parse_options_takes_argument()Christian Couder, Sep 23, 2026
  19. 2/3 parse-options: add early_scan_options()Christian Couder, Sep 23, 2026
  20. Kaartic SivaraamSep 30, 2026
  21. Christian CouderOct 12, 2026
  22. 3/3 fast-import: use early_scan_options() for --allow-unsafe-featuresChristian Couder, Sep 23, 2026
  23. 0/4 Standardize early option scanningChristian Couder, Oct 12, 2026
  24. 1/4 parse-options: add parse_options_takes_argument()Christian Couder, Oct 12, 2026
  25. 2/4 parse-options: extract lookup_long_opt() from parse_long_opt()Christian Couder, Oct 12, 2026
  26. Kaartic SivaraamOct 30, 2026
  27. Christian CouderNov 2, 2026
  28. 3/4 parse-options: add early_scan_options()Christian Couder, Oct 12, 2026
  29. Kaartic SivaraamOct 30, 2026
  30. Christian CouderNov 2, 2026
  31. 4/4 fast-import: use early_scan_options() for --allow-unsafe-featuresChristian Couder, Oct 12, 2026
  32. Cynthia UcheOct 31, 2026
  33. Christian CouderNov 2, 2026
  34. Kaartic SivaraamOct 30, 2026
  35. 0/4 Standardize early option scanningChristian Couder, Nov 2, 2026
  36. 1/4 parse-options: add parse_options_takes_argument()Christian Couder, Nov 2, 2026
  37. 2/4 parse-options: extract lookup_long_opt() from parse_long_opt()Christian Couder, Nov 2, 2026
  38. 3/4 parse-options: add early_scan_options()Christian Couder, Nov 2, 2026
  39. 4/4 fast-import: use early_scan_options() for --allow-unsafe-featuresChristian Couder, Nov 2, 2026
  40. Kaartic SivaraamNov 3, 2026
  41. Junio C HamanoNov 3, 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.