Christian Couder's six-patch series addresses commands that scan their arguments early for flags or for "--". These hand-rolled scans often ignore options that take their value as a separate argument. The early scan can then disagree with the later parse_options() pass, by missing a special option or by treating an option's value as the path separator. The series adds an "early-scan" sub-API to parse-options so commands can skip option values safely.

Cynthia Uche ran t0040 and t9300 on the cc/early-scan-options topic as it appears in origin/seen (tip dabb68a20d). All 118 tests in t0040 passed, including the new early-scan tests, as did all 261 in t9300, including the new R: tests.

She also noted a mismatch in one caller. The call passes EARLY_SCAN_STOP_AT_NON_OPTION, but the header in 3/4 says to pass it when parse_options() is called with PARSE_OPT_STOP_AT_NON_OPTION or with subcommands. Here parse_argv() uses only PARSE_OPT_KEEP_ARGV0 and has no subcommands. She said stopping at the first non-option is the safe direction and matches the old loop.

The thread is long, with 31 messages, and Junio C Hamano and Kaartic Sivaraam have also taken part. The excerpts do not show whether Couder has answered.