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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



karthik nayak <karthik.188@xxxxxxxxx> writes:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
>
>> karthik nayak <karthik.188@xxxxxxxxx> 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.

That said, I see v1 is merged into `next` [1]. I think we should keep it
that way and like you said modify it in the future if needed to add
varargs or another `void *` argument.

Thanks

[1]: https://github.com/gitster/git/commit/668c0913f5803ebcc3b0b1f13e6cd49503194869

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux