Re: [BUG] Git push sends too much data unnecessarily
- From
Rajiv Sharma <rajiv.tilakraj.sharma@gmail.com>
- Date
- Jan 14, 2026, 17:39 UTC
- Message-ID
- <CAGe2LO3t3B1g1ARH-LQ9V0UoGmToO-Z9XYpeMOTKkaSQvCpaRA@mail.gmail.com>
- In-Reply-To
- <xmqqh5sof61i.fsf@gitster.g>
Thanks for the great explanation! You are right, it's not really a bug (because there is no correctness problem here) but it surely is suboptimal behavior.
> This boils down to how Git negotiates between the client <> server
I think that's the crux of the problem here. I don't think git negotiates in the push path the way it does in the read path, i.e. there is no process of client-server communication that involves gradually arriving at the common base (in this case it would be C3). The read path does this quite well (using something akin to a skiplist IIRC?) and the common base is found in a couple iterations in most cases. I am unaware of the historical context behind this difference but I assume the server sending unnecessary extra data during the read path would be much more expensive than the client doing it hence the push protocol is kept simpler.
This kind of negotiation _could_ be added to the push path but it would be a breaking change. I read somewhere that there were plans for Push Protocol V2 (in the same vein as Read Protocol V2) so it would be great to see this improvement making its way there!
Thanks Rajiv Sharma
On Wed, Jan 14, 2026 at 5:38 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> > Karthik Nayak <karthik.188@gmail.com> writes: > > > So it sends all objects required to create the reference, in our case 4 > > objects, in your case GBs of data. > > "push.negotiate"?