Re: [PATCH 6/6] send-pack: support push negotiation

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

 



On 5/3/2021 6:02 PM, Jonathan Tan wrote:
> [snip asking about whether extra_have (a.k.a. advertised) and commons (a.k.a.
> negotiated) can be merged]
> 
>> Here, it would be nice if extra_have and commons were merged before calling
>> pack_objects(). I mentioned a way to perhaps make that easier above, but
>> the context might not make that be super-simple. Running a loop here to
>> scan 'commons' and append them to 'extra_have' might be a sufficient
>> approach.
>>
>> Generally, this approach seems like it would work. I have not done any
>> local testing, yet.
>>
>> Thanks,
>> -Stolee
> 
> I was reluctant to merge them because that would involve either (1)
> adding commons to "extra_have" (as you suggest) or (2) iterating through
> "extra_have" in order to add it to the "commons" set. For (1), this
> would modify "extra_have", which is passed in from the outside. Looking
> at its callers, the main one in git_transport_push() in transport.c
> calls send_pack() with a set that has traversed the transport API, so I
> think it would be confusing if such a set suddenly changed. For (2), the
> extra loop seems more troublesome than having two parameters with
> clearer names indicating where they come from. I don't mind changing to
> (2), though, if people want it.
 
I suppose this concern about "ownership" is valid and worth having the
two parameters in the helper function for extra safety.

Thanks,
-Stolee



[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