{"thread":{"id":"40067","subject":"pack negotiation algorithm between 2 share-nothing repos","startedAt":"2015-08-12T11:27:24Z","lastAt":"2015-08-26T16:49:56Z","messageCount":3,"participants":["Duy Nguyen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"267898","messageId":"CACsJy8AKKYux6w=6X392mJhGFfqfEvJsrX0PjcivHPt2PYVKAw@mail.gmail.com","threadId":"40067","inReplyTo":null,"subject":"pack negotiation algorithm between 2 share-nothing repos","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-08-12T11:27:24Z","receivedAt":"2015-08-12T11:27:24Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This is a corner case that has a real use case:\n\ngit clone linux-2.6.git\ncd linux-2.6\ngit remote add history git-history.git\ngit fetch history\n# graft graft graft\n\nBecause history.gi and linux-2.6.git have nothing in common, the\nserver side keeps asking for more \"have\"s and the client keeps sending\nin \"git fetch history\". Negotiation phase takes longer than my\npatience so I abort it, hack git to send no \"have\"s and retry.\n\nI know this is a corner case, but because it has a valid use case,\nmaybe we should do something about it. Immediate reaction is to add an\noption to send no \"have\"s. But maybe you guys have better ideas.\n\nPS. I know i'm behind my git inbox. Looking into it soon.\n-- \nDuy\n"},{"id":"267913","messageId":"xmqqk2t0mrhi.fsf@gitster.dls.corp.google.com","threadId":"40067","inReplyTo":"CACsJy8AKKYux6w=6X392mJhGFfqfEvJsrX0PjcivHPt2PYVKAw@mail.gmail.com","subject":"Re: pack negotiation algorithm between 2 share-nothing repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-08-12T15:55:05Z","receivedAt":"2015-08-12T15:55:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> I know this is a corner case, but because it has a valid use case,\n> maybe we should do something about it. Immediate reaction is to add an\n> option to send no \"have\"s. But maybe you guys have better ideas.\n\nThis and similar corner cases were discussed in very early days of\nGit.\n\nOne interesting idea floated back then but was not pursued was to\ndig and send have's sparsely and then back up.  Instead of digging\nand sending _all_ commits in a contiguous history, after sending the\ntip, you skip the commits from the history before sending the next\none, and progressively make the skipping larger (e.g. Fibonacci, or\nexponential).  You need to remember what you sent and for each of\nwhat you sent its topologically-oldest descendant you sent earlier\nthat you heard the other side does not have.\n\nThen, when you get an Ack, you know a stretch of history between a\ncommit that is known to be common (i.e. the one you heard an Ack\njust now) and its descendant that is known only to you (i.e. the\ntopologically-oldest one you remember that you did send and they\ndidn't say is common).  At that point, you and the other end can\nbisect that range.\n"},{"id":"268736","messageId":"xmqqbnduuh8r.fsf@gitster.dls.corp.google.com","threadId":"40067","inReplyTo":"xmqqk2t0mrhi.fsf@gitster.dls.corp.google.com","subject":"Re: pack negotiation algorithm between 2 share-nothing repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-08-26T16:49:56Z","receivedAt":"2015-08-26T16:49:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Duy Nguyen <pclouds@gmail.com> writes:\n>\n>> I know this is a corner case, but because it has a valid use case,\n>> maybe we should do something about it. Immediate reaction is to add an\n>> option to send no \"have\"s. But maybe you guys have better ideas.\n>\n> This and similar corner cases were discussed in very early days of\n> Git.\n>\n> One interesting idea floated back then but was not pursued was to\n> dig and send have's sparsely and then back up.  Instead of digging\n> and sending _all_ commits in a contiguous history, after sending the\n> tip, you skip the commits from the history before sending the next\n> one, and progressively make the skipping larger (e.g. Fibonacci, or\n> exponential).  You need to remember what you sent and for each of\n> what you sent its topologically-oldest descendant you sent earlier\n> that you heard the other side does not have.\n>\n> Then, when you get an Ack, you know a stretch of history between a\n> commit that is known to be common (i.e. the one you heard an Ack\n> just now) and its descendant that is known only to you (i.e. the\n> topologically-oldest one you remember that you did send and they\n> didn't say is common).  At that point, you and the other end can\n> bisect that range.\n\nIf anybody is interested, here is a good place to start:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/96149/focus=102485\n\n[Cc'ed Stefan as I think he was collecting possible enhancement to\nput in the protocol v2].\n"}]}