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

Re: [PATCH v2] builtin: allow passing custom data to sub-commands

From
karthik nayak <karthik.188@gmail.com>
Date
Nov 27, 2024, 09:15 UTC
Message-ID
<CAOLa=ZQgKv4SEPRqQix8pJo1nr30Fpg2oF-LdDX1ynHeSjDcGw@mail.gmail.com>
In-Reply-To
<xmqqy115x0be.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> karthik nayak <karthik.188@gmail.com> writes:
>
>> Could you elaborate on why you think this is an over-optimization? We
>> don't loose functionality with this, nor do we have to have add
>> additional code to handle the typecasting to `struct repository *` if
>> needed. But would definitely like to resolve anything I missed.
>
> I do not know if it is an optimization, but if you know it is of a
> specific type, casting back and force with "void *" loses type
> safety, no?

That is true of course, I just thought that is the price to pay in C for having to deal with generic data propagation. In the end I'm okay with both scenarios, I see merits both ways. I do tend to incline on the generic version in v2, since it is a lot more expandable.

Previous: Junio C HamanoNext: karthik nayak
Message 11 of 12 in “builtin: pass repository to sub commands”
  1. builtin: pass repository to sub commandsKarthik Nayak, Nov 25, 2024
  2. Christian CouderNov 26, 2024
  3. karthik nayakNov 26, 2024
  4. Patrick SteinhardtNov 26, 2024
  5. karthik nayakNov 26, 2024
  6. Junio C HamanoNov 26, 2024
  7. builtin: allow passing custom data to sub-commandsKarthik Nayak, Nov 26, 2024
  8. shejialuoNov 26, 2024
  9. karthik nayakNov 26, 2024
  10. Junio C HamanoNov 26, 2024
  11. karthik nayakNov 27, 2024
  12. karthik nayakNov 27, 2024

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.