On Tue, Sep 11, 2007 at 04:26:14PM +0000, Johannes Schindelin wrote: > Hi, > > On Tue, 11 Sep 2007, Pierre Habouzit wrote: > > > On Tue, Sep 11, 2007 at 03:03:21AM +0000, Johannes Schindelin wrote: > > > static const struct transport_ops bundle_transport = { > > > + /* set_option */ NULL, > > > + /* get_refs_list */ get_refs_from_bundle, > > > + /* fetch_refs */ fetch_refs_from_bundle, > > > + /* fetch_objs */ NULL, > > > + /* push */ NULL, > > > + /* disconnect */ close_bundle > > > > Not that I care that much, and I don't know what is done in git > > usually. But aren't C99 initializer safer ? (wrt struct transport_ops > > API possible changes in the future). > > No, they are not, since we do not allow such backwards incompatibilifiers > to creep into git's code. > > Yes, I know some would prefer the latest and greatest, and another > language altogether, but keep this in mind: what if somebody made git > incompatible with _your_ setup? So really, don't do it to others that > lightly. It has nothing to do with latest. I feel that if for some reason transport_ops need a new function, it will break silentely, whereas if you use: static const struct transport_ops bundle_transport = { + .set_option = NULL, + .get_refs_list = &get_refs_from_bundle, + .fetch_refs = &fetch_refs_from_bundle, + .fetch_objs = NULL, + .push = NULL, + .disconnect = &close_bundle Or even: static const struct transport_ops bundle_transport = { + .get_refs_list = &get_refs_from_bundle, + .fetch_refs = &fetch_refs_from_bundle, + .disconnect = &close_bundle It's pretty straightforward to extend the transport_ops API, afaict it's what the kernel does e.g.. I wasn't suggesting anything else. -- ·O· Pierre Habouzit ··O madcoder@xxxxxxxxxx OOO http://www.madism.org
Attachment:
pgpsXXZUy2pdy.pgp
Description: PGP signature