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

Re: [PATCH 2/2] parse-options API: remove OPTION_ARGUMENT feature

From
Jeff King <peff@peff.net>
Date
Sep 12, 2021, 22:43 UTC
Message-ID
<YT6ChAivw2Vk7Jkd@coredump.intra.peff.net>
In-Reply-To
<patch-2.2-28b43789b11-20210911T182009Z-avarab@gmail.com>
On Sat, Sep 11, 2021 at 08:21:12PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 14 quoted lines
> As was noted in 1a85b49b87a (parse-options: make OPT_ARGUMENT() more
> useful, 2019-03-14) there's only ever been one user of the
> OPT_ARGUMENT(), that user was added in 20de316e334 (difftool: allow
> running outside Git worktrees with --no-index, 2019-03-14).
> 
> The OPT_ARGUMENT() feature itself was added way back in
> 580d5bffdea (parse-options: new option type to treat an option-like
> parameter as an argument., 2008-03-02), but as discussed in
> 1a85b49b87a wasn't used until 20de316e334 in 2019.
> 
> Now that the preceding commit has migrated this code over to using
> "struct strvec" to manage the "args" member of a "struct
> child_process", we can just use that directly instead of relying on
> OPT_ARGUMENT.

Yeah, the change in difftool here looks fine (regardless of how the cleanup in the first patch gets there). And I'm happy to see this somewhat weird OPT_ macro go away if nobody is using it.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 7 of 17 in “parse-options.c: remove OPT_ARGUMENT”
  1. 0/2 parse-options.c: remove OPT_ARGUMENTÆvar Arnfjörð Bjarmason, Sep 11, 2021
  2. 1/2 difftool: use "struct strvec" API in run_{dir,file}_diff()Ævar Arnfjörð Bjarmason, Sep 11, 2021
  3. Jeff KingSep 12, 2021
  4. Jeff KingSep 12, 2021
  5. Junio C HamanoSep 13, 2021
  6. 2/2 parse-options API: remove OPTION_ARGUMENT featureÆvar Arnfjörð Bjarmason, Sep 11, 2021
  7. Jeff KingSep 12, 2021
  8. 0/4 difftool refactoring + remove OPT_ARGUMENT() macroÆvar Arnfjörð Bjarmason, Sep 13, 2021
  9. 2/4 difftool: prepare "diff" cmdline in cmd_difftool()Ævar Arnfjörð Bjarmason, Sep 13, 2021
  10. 1/4 difftool: prepare "struct child_process" in cmd_difftool()Ævar Arnfjörð Bjarmason, Sep 13, 2021
  11. 3/4 difftool: use run_command() API in run_file_diff()Ævar Arnfjörð Bjarmason, Sep 13, 2021
  12. Jeff KingSep 13, 2021
  13. Ævar Arnfjörð BjarmasonSep 13, 2021
  14. Jeff KingSep 13, 2021
  15. 4/4 parse-options API: remove OPTION_ARGUMENT featureÆvar Arnfjörð Bjarmason, Sep 13, 2021
  16. Junio C HamanoSep 13, 2021
  17. Jeff KingSep 13, 2021

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.