{"thread":{"id":"53699","subject":"filtering on git fetch?","startedAt":"2020-06-17T07:41:45Z","lastAt":"2020-06-17T11:32:37Z","messageCount":4,"participants":["Noel Grandin","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"399953","messageId":"f6c1377f-6945-b04f-07cf-887c4b7c9f76@gmail.com","threadId":"53699","inReplyTo":null,"subject":"filtering on git fetch?","fromName":"Noel Grandin","fromEmail":"noelgrandin@gmail.com","sentAt":"2020-06-17T07:41:37Z","receivedAt":"2020-06-17T07:41:45Z","isPatch":false,"sender":{"key":"noelgrandin@gmail.com","avatar":"https://gravatar.com/avatar/b685e19fd968554f6be11c7ce8f8bca0b38b6b22e3e07504f7aefae16a234374?d=mp&s=160"},"body":"Hi\n\nSetup\n\n(*) I'm fetching across a transatlantic link (RTT in the 300ms range on a good day)\n(*) I'm fetching from a gerrit server\n\n$ GIT_PACKET_TRACE=true git fetch\n\nshows tons and tons of\n\n09:39:43.355675 pkt-line.c:80           packet:        fetch< 3a7ad7ee5d7daa0c93a80fbb32a677597d81ac75 \nrefs/changes/00/9000/3\n09:39:43.355684 pkt-line.c:80           packet:        fetch< 6cacf1db5311f6b250ebaa12c71419a8ff9b747e \nrefs/changes/00/9000/meta\n09:39:43.355693 pkt-line.c:80           packet:        fetch< 849a43434a5ede9ce9b70da14231f34edb2593fb \nrefs/changes/00/90100/1\n\ntype stuff before it starts fetching the updates to master that I am interested in.\n\nIs there any way to tell the remote git server that I'm only interested in a subset of stuff?\n\nThanks, Noel Grandin\n"},{"id":"399959","messageId":"20200617083423.GA695303@coredump.intra.peff.net","threadId":"53699","inReplyTo":"f6c1377f-6945-b04f-07cf-887c4b7c9f76@gmail.com","subject":"Re: filtering on git fetch?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-06-17T08:34:23Z","receivedAt":"2020-06-17T08:34:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 17, 2020 at 09:41:37AM +0200, Noel Grandin wrote:\n\n> Setup\n> \n> (*) I'm fetching across a transatlantic link (RTT in the 300ms range on a good day)\n> (*) I'm fetching from a gerrit server\n> \n> $ GIT_PACKET_TRACE=true git fetch\n> \n> shows tons and tons of\n> \n> 09:39:43.355675 pkt-line.c:80           packet:        fetch<\n> 3a7ad7ee5d7daa0c93a80fbb32a677597d81ac75 refs/changes/00/9000/3\n> 09:39:43.355684 pkt-line.c:80           packet:        fetch<\n> 6cacf1db5311f6b250ebaa12c71419a8ff9b747e refs/changes/00/9000/meta\n> 09:39:43.355693 pkt-line.c:80           packet:        fetch<\n> 849a43434a5ede9ce9b70da14231f34edb2593fb refs/changes/00/90100/1\n> \n> type stuff before it starts fetching the updates to master that I am interested in.\n> \n> Is there any way to tell the remote git server that I'm only interested in a subset of stuff?\n\nThe ref advertisement in the v0 protocol is unconditional and always\ncomplete. In v2, the client is able to specify which parts of the\nnamespace it cares about.\n\nTry:\n\n  GIT_TRACE_PACKET=1 git -c protocol.version=2\n\nThis will probably be the default in v2.28 (it was the default in v2.26,\nbut there was a performance regression, so we backed it out for v2.27).\n\n-Peff\n"},{"id":"399961","messageId":"e3ec6fec-b872-b548-0eb0-d085ca36c99b@gmail.com","threadId":"53699","inReplyTo":"20200617083423.GA695303@coredump.intra.peff.net","subject":"Re: filtering on git fetch?","fromName":"Noel Grandin","fromEmail":"noelgrandin@gmail.com","sentAt":"2020-06-17T08:42:24Z","receivedAt":"2020-06-17T08:42:35Z","isPatch":false,"sender":{"key":"noelgrandin@gmail.com","avatar":"https://gravatar.com/avatar/b685e19fd968554f6be11c7ce8f8bca0b38b6b22e3e07504f7aefae16a234374?d=mp&s=160"},"body":"\n\nOn 2020/06/17 10:34 am, Jeff King wrote:\n> \n> The ref advertisement in the v0 protocol is unconditional and always\n> complete. In v2, the client is able to specify which parts of the\n> namespace it cares about.\n\nThanks\n\nI tried (BTW my version is 2.26.2)\n\n$ GIT_TRACE_PACKET=1 git -c protocol.version=2 pull -r\n\nand the first few lines look like\n\n10:35:59.323490 pkt-line.c:80           packet:        fetch< ad0351b84926075297fb74abbe9b31a0455782af HEAD\\0 \ninclude-tag multi_ack_detailed multi_ack o\nfs-delta side-band side-band-64k thin-pack no-progress shallow agent=JGit/5.3.7.202002110540-r symref=HEAD:refs/heads/master\n10:35:59.323583 pkt-line.c:80           packet:        fetch< baeb5486c43d39b063371f91cfaae8efc2c8700b \nrefs/changes/00/1000/1\n10:35:59.323592 pkt-line.c:80           packet:        fetch< c5fb3d3f110f652e3c4b3920f71b7f77c227028e \nrefs/changes/00/1000/meta\n10:35:59.323597 pkt-line.c:80           packet:        fetch< dfbfb3c4d4cc7d7f519c197ef5cfa250c30b584b \nrefs/changes/00/10000/1\n10:35:59.323602 pkt-line.c:80           packet:        fetch< 5955e7d66d9b0e87f93fd9746a85bff132da9794 \nrefs/changes/00/10000/2\n10:35:59.323608 pkt-line.c:80           packet:        fetch< ae3baacef7926d9ce9ca4786176f404b7cf78cc1 \nrefs/changes/00/10000/meta\n\nIs there something else I need to do on the client-side to make this work?\n\nNoting that the git server at gerrit.libreoffice.org might be a JGit based thing, so maybe I need to log a feature \nrequest there to support v2?\n\n"},{"id":"399969","messageId":"20200617113234.GA703467@coredump.intra.peff.net","threadId":"53699","inReplyTo":"e3ec6fec-b872-b548-0eb0-d085ca36c99b@gmail.com","subject":"Re: filtering on git fetch?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-06-17T11:32:34Z","receivedAt":"2020-06-17T11:32:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 17, 2020 at 10:42:24AM +0200, Noel Grandin wrote:\n\n> I tried (BTW my version is 2.26.2)\n> \n> $ GIT_TRACE_PACKET=1 git -c protocol.version=2 pull -r\n\nAh, yeah, I think it should be the default in that version anyway.\n\n> and the first few lines look like\n> \n> 10:35:59.323490 pkt-line.c:80           packet:        fetch<\n> ad0351b84926075297fb74abbe9b31a0455782af HEAD\\0 include-tag\n> multi_ack_detailed multi_ack o\n> fs-delta side-band side-band-64k thin-pack no-progress shallow agent=JGit/5.3.7.202002110540-r symref=HEAD:refs/heads/master\n\nYep, that's definitely v0.\n\n> Is there something else I need to do on the client-side to make this work?\n\nNo, probably the server doesn't support v2. I double-checked myself, and\ncouldn't get it to speak v2 either.\n\n> Noting that the git server at gerrit.libreoffice.org might be a JGit based\n> thing, so maybe I need to log a feature request there to support v2?\n\nProbably.  I'm fairly certain that JGit has supported v2 for a while.\nJust poking at `git log` in jgit.git shows some commits adding it around\nthe 5.0 timeframe. So I'd think the version they're advertising would\nhave it. I don't know offhand if there's a config option they'd need to\nflip on the server.\n\n-Peff\n"}]}