model-writtenrun 4202 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nathan Bossart proposed reordering non-options in the in-tree getopt_long implementation to eliminate recurring Windows argument-order failures, initially allowing POSIXLY_CORRECT to disable it while leaving plain getopt unchanged #1.
- Kyotaro Horiguchi questioned the runtime switch, Michael Paquier raised AIX compatibility concerns, and Noah Misch demonstrated successful argv mutation on both 32-bit and 64-bit AIX builds; the discussion accepted possible transient process-title oddities and Nathan removed POSIXLY_CORRECT support #2 #6 #10 #12 #13.
- Michael requested documentation of argv mutation, and Nathan added it while also correcting lone '-' handling #14 #15.
- Kyotaro found that '--' caused earlier non-options to move behind later arguments, prompting Nathan to preserve their original order with force_nonopt state; Kyotaro then compared example cases with glibc and confirmed that the TAP test caught the behavior change #16 #17 #18.
- Nathan subsequently reorganized the scan into a loop, but Kyotaro found the conditions harder to read and preferred the retry label; the resulting revisions restored that structure, simplified comparisons, and reordered equivalent predicates #20 #21 #23 #24 #25.
- Nathan committed #25 as 411b720343 with small comment and equivalent character-test edits, explaining that an audit of callers made the quadratic shifting cost acceptable for their expected argument counts #26.
- That audit also uncovered pg_ctl's workaround for implementations without argument reordering, so Nathan submitted a separate patch to remove its outer option-processing loop #26.
- Michael initially reported Windows CI failures for the pg_ctl cleanup, and Kyotaro investigated the early termination, but Nathan identified a missing prerequisite commit; Michael corrected his rebase and obtained a clean CI run #27 #28 #29 #30.
- Michael questioned why the cleanup changed the argument named in excess-argument errors, but Nathan showed that naming the first extra argument matched other utilities, and Michael withdrew the objection #30 #31 #32.
- Nathan committed the pg_ctl attachment from #26 unchanged as 03d1080d8a and announced completion #33.
- Months later, Tom Lane connected a user complaint to the old pg_ctl diagnostic and raised backpatching, but he and Nathan agreed that fixing the apparently longstanding issue in stable branches was probably not worthwhile #34 #35 #36.
- The thread ends with both changes landed and no further patch pending: Nathan explained why getopt_long resetting optind likely made the diagnostic bug longstanding, while Tom had suggested watching for similar reports #36 #37.