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

Re: [PATCH] Use OPT_CALLBACK and OPT_CALLBACK_F

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2020, 17:34 UTC
Message-ID
<xmqq368n4iql.fsf@gitster.c.googlers.com>
In-Reply-To
<20200428084543.GC2381876@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> On Tue, Apr 28, 2020 at 04:36:28AM -0400, Denton Liu wrote:
>
>> In the codebase, there are many options which use OPTION_CALLBACK in a
>> plain ol' struct definition. However, we have the OPT_CALLBACK and
>> OPT_CALLBACK_F macros which are meant to abstract these plain struct
>> definitions away. These macros are useful as they semantically signal to
>> developers that these are just normal callback option with nothing fancy
>> happening.
>
> I think this is worth doing. It's a little easier to read, and sets a
> better example anyone copying the code.
Sure.

And it would be much nicer if the patch actually applies. I am getting "SHA-1 information for builtin/push.c is unusable" from "am -3".

I'd reject the first hunk on builtin/push.c as that part should be done with an updated version of the patch that is titled "push: unset PARSE_OPT_OPTARG for --recurse-submodules" and apply the rest as an independent clean-up patch.

Thanks, both.
Previous: Jeff KingNext: Junio C Hamano
Message 7 of 9 in “Bug v2.23.0: command help for 'git push --recurse-submodules' is incorrect”
  1. Andrew WhiteApr 27, 2020
  2. push: unset PARSE_OPT_OPTARG for --recurse-submodulesDenton Liu, Apr 27, 2020
  3. Jeff KingApr 27, 2020
  4. Junio C HamanoApr 27, 2020
  5. Use OPT_CALLBACK and OPT_CALLBACK_FDenton Liu, Apr 28, 2020
  6. Jeff KingApr 28, 2020
  7. Junio C HamanoApr 28, 2020
  8. Junio C HamanoApr 28, 2020
  9. Denton LiuApr 28, 2020

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.