From: karthik nayak Date: Wed, 27 Nov 2024 09:15:59 GMT Subject: Re: [PATCH v2] builtin: allow passing custom data to sub-commands Message-ID: In-Reply-To: Junio C Hamano writes: > karthik nayak 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.