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

Re: How to not download objects more than needed?

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 22, 2006, 00:42 UTC
Message-ID
<Pine.LNX.4.64.0602211635450.30245@g5.osdl.org>
In-Reply-To
<BAYC1-PASMTP03A58A4F389365AC85DA68AEFC0@CEZ.ICE>
On Tue, 21 Feb 2006, sean wrote:
Show 7 quoted lines
> 
> > I have linux-2.6 repository pulled and I'd like to download some branch
> > (say, netdev-2.6), which uses many of the same objects,
> > but not to get all the objects from the git server.
> 
> Just make sure you're not using the rsync protocol.   Using the
> native git protocol would be best.

Side note: the "automatic tag following" is broken wrt pulling unnecessary objects, even with the git protocol.

What happens is that if you don't explicitly have a branch for what you are pulling, and you do something like

	git pull git://git.kernel.org/....

and the automatic tag following kicks in, it will first have fetched the objects once, and then when it tries to fetch the tag objects, it will fetch the objects it already fetched _again_ (plus the tags), because it will do the same object pull, but the temporary branch (to be merged) will never have been written as a branch head.

So you'll see something like
	Generating pack...
	Done counting <x> objects.
	Packing <x> objects.......................
	Unpacking <x> objects
	 100% (<x>/<x>) done
	Auto-following refs/tags/v1.2.2
	Generating pack...
	Done counting <x+1> objects.
	Packing <x+1> objects.......................
	Unpacking <x+1> objects
	 100% (<x+1>/<x+1>) done
	* refs/tags/v1.2.2: storing tag 'v1.2.2' of master.kernel.org:/pub/scm/git/git

just because we hadn't updated any refs before we started re-fetching more objects.

So we do have cases where we fetch unnecessarily even with the native protocol.

		Linus
Previous: seanNext: Jan Harkes
Message 3 of 10 in “How to not download objects more than needed?”
  1. Radoslaw SzkodzinskiFeb 21, 2006
  2. seanFeb 21, 2006
  3. Linus TorvaldsFeb 22, 2006
  4. Jan HarkesFeb 22, 2006
  5. Junio C HamanoFeb 22, 2006
  6. Jan HarkesFeb 22, 2006
  7. Junio C HamanoFeb 22, 2006
  8. git-fetch: follow tag only when tracking remote branch.Junio C Hamano, Feb 22, 2006
  9. Andreas EricssonFeb 22, 2006
  10. Junio C HamanoFeb 21, 2006

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.