Re: Thoughts on refactoring the transport (+helper) code

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

 



On Thu, Aug 13, 2015 at 12:45 PM, Ilari Liusvaara
<ilari.liusvaara@xxxxxxxxxxx> wrote:
> On Thu, Aug 13, 2015 at 11:42:50AM -0400, Dave Borowitz wrote:
>>
>> In my ideal world:
>> -smart_options would never be NULL, and would instead be called
>> "options" with a "smart" bit which is unset for dumb protocols.
>> -Command line option processing code in {fetch,clone,push}.c would set
>> fields in options (formerly known as smart_options) rather than
>> passing around string constants.
>> -TRANS_OPT_* string constants would only be used for remote helper
>> protocol option names, and no more hard-coding these names.
>> -The flags arg to the push* callbacks would go away, and callbacks
>> would respect options instead.
>> -The helper code would not send options immediately, but instead send
>> just the relevant options immediately before a particular command
>> requires them. Hopefully we could then eliminate the set_option
>> callback entirely. (Two things I ran into that complicated this: 1)
>> backfill_tags mutates just a couple of options before reusing the
>> transport, and 2) the handling of push_cas_option is very
>> special-cased.)
>
> AFAIK, here are what one can encounter with remote helpers:
>
> Some remote helpers are always smart, some are always dumb, and some
> may be smart or dumb, depending on the URL.
>
> I don't know how useful the last one is (smart or dumb depending on
> URL) is. I have never seen such remote helper (HTTP doesn't count,
> from Git PoV it is always dumb).
>
> All smart helpers take common options associated with git smart
> transport (e.g. thin, follow tags, push certs, etc..).
>
> Dumb transports may take some of these kind of of options (esp.
> smart HTTP), but it is highly dependent on the helper.
>
> Then transports can have connection-level options (e.g. HTTPS
> cert options). These can be present regardless of wheither
> transport is smart or dumb.
>
> The receive-pack / send-pack paths fall into connection-level
> options, even if those are presently in smart transport common
> options. Since those things make sense for some smart transports
> (e.g. ssh://), but not others (e.g. git://).

Yeah, thanks for summarizing some of the differences between options.
The really confusing thing when looking at the code, though, is that
the various different ways of specifying options in the code don't
actually align with those distinctions. Maybe they once did, but they
certainly don't today.

I wouldn't be opposed to splitting up git_transport_options into
different structs for connection options, smart fetch options, smart
push options, etc., rather than putting everything in one kitchen-sink
struct.

>
> -Ilari
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]