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

git-remote questions: --reference? Plus a git-clone --remote observation.

From
IMIngo Molnar <mingo@elte.hu>
Date
May 10, 2008, 10:52 UTC
Message-ID
<20080510105235.GA17577@elte.hu>
git-1.5.4.3-2.fc8.

Today i tried to set up a new tracking repository from scratch and used git-remote to populate it. It took a lot of time because it downloaded it all from the remote site - but i already had most of those commits locally.

I'm using git-clone --reference quite extensively to speed up the creation of such new repositories, and i'm wondering whether something similar is available/planned for git-remote as well?

Also, i noticed a weirdness about "git-clone --reference" today.

As per the log below, i tried to use a large repository with lots of remote tracking branches as a reference for cloning - but there were a suprisingly large number of objects to be downloaded - 18K of them.

When i did the same with a linux-2.6.git repository (Linus's upstream tree), i only had 1915 commits to fetch.

But Linus's tree is already tracked in the linux.trees.git super-repository! I double-checked that both linux-2.6.git and linux.trees.git had the exact same head for Linus's tree. So why did --reference=super-tree have to download much more than if i used the smaller reference tree?

now, i'd expect --reference to just fetch every object locally that it can - regardless of the composition of that tree. Apparently it matters what the current head is in a repository that is used via --reference?

	Ingo
---------->

$ git-clone --reference=linux.trees.git ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git linux-tmp6 Initialized empty Git repository in /home/mingo/linux-tmp6/.git/ remote: Counting objects: 18014, done. remote: Compressing objects: 31% (5273/17009)

$ git-clone --reference=linux-2.6.git ssh://master.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git linux-tmp5 Initialized empty Git repository in /home/mingo/linux-tmp5/.git/ remote: Counting objects: 1915, done. remote: Compressing objects: 100% (765/765), done.

Message 1 of 1 in “git-remote questions: --reference? Plus a git-clone --remote observation.”
  1. Ingo MolnarMay 10, 2008

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.