git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: filtering on git fetch?

From
Jeff King <peff@peff.net>
Date
Jun 17, 2020, 08:34 UTC
Message-ID
<20200617083423.GA695303@coredump.intra.peff.net>
In-Reply-To
<f6c1377f-6945-b04f-07cf-887c4b7c9f76@gmail.com>
On Wed, Jun 17, 2020 at 09:41:37AM +0200, Noel Grandin wrote:
Show 19 quoted lines
> Setup
> 
> (*) I'm fetching across a transatlantic link (RTT in the 300ms range on a good day)
> (*) I'm fetching from a gerrit server
> 
> $ GIT_PACKET_TRACE=true git fetch
> 
> shows tons and tons of
> 
> 09:39:43.355675 pkt-line.c:80           packet:        fetch<
> 3a7ad7ee5d7daa0c93a80fbb32a677597d81ac75 refs/changes/00/9000/3
> 09:39:43.355684 pkt-line.c:80           packet:        fetch<
> 6cacf1db5311f6b250ebaa12c71419a8ff9b747e refs/changes/00/9000/meta
> 09:39:43.355693 pkt-line.c:80           packet:        fetch<
> 849a43434a5ede9ce9b70da14231f34edb2593fb refs/changes/00/90100/1
> 
> type stuff before it starts fetching the updates to master that I am interested in.
> 
> Is there any way to tell the remote git server that I'm only interested in a subset of stuff?

The ref advertisement in the v0 protocol is unconditional and always complete. In v2, the client is able to specify which parts of the namespace it cares about.

Try:
  GIT_TRACE_PACKET=1 git -c protocol.version=2

This will probably be the default in v2.28 (it was the default in v2.26, but there was a performance regression, so we backed it out for v2.27).

-Peff
Previous: Noel GrandinNext: Noel Grandin
Message 2 of 4 in “filtering on git fetch?”
  1. Noel GrandinJun 17, 2020
  2. Jeff KingJun 17, 2020
  3. Noel GrandinJun 17, 2020
  4. Jeff KingJun 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.