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

Re: git fetch --reference?

From
Junio C Hamano <junkio@cox.net>
Date
Nov 15, 2006, 01:02 UTC
Message-ID
<7vy7qdttc0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<f2b55d220611141638k5f4a0aeas1a43301e4b40bf59@mail.gmail.com>
"Michael K. Edwards" <medwards.linux@gmail.com> writes:
Show 10 quoted lines
> When setting up a working area for kernel integration for a new
> embedded target, I generally do a "git clone --reference" so that the
> new area has its own repository (and its own branch structure) but
> most of the blobs come from a local reference copy.  But now that I'm
> integrating bits from several non-trivially divergent trees (mtd-2.6,
> netdev-2.6, linux-2.6.16.y, etc.), it would be nice to avoid
> re-downloading blobs for these additional remote branches, which are
> also available in the local reference copy.  Is it feasible to
> implement "git fetch --reference" for this purpose?  Or is there a
> better way to manage this sort of integration effort?

I am somewhat doubtful that this is common enough to warrant adding an extra option to "git fetch", but you could add alternates to these new reference object stores before initiating the fetch.

For example, if you have pristine linux-2.6/ and your work was started by cloning with --reference to it into my-2.6/, you would have something like this:

	$ cd /usr/src
	$ ls -F
        linux-2.6/ linux-2.6.16.y/ netdev-2.6/ my-2.6/
	$ cd my-2.6/
        $ cat .git/objects/info/alternates
	/usr/src/linux-2.6/.git/objects
Then you would (still in my-2.6 repository):
	$ cat >>.git/objects/info/alternates
        /usr/src/linux-2.6.16.y/.git/objects
        /usr/src/netdev-2.6/.git/objects
        $ git pull ../netdev-2.6/ ALL

which would hopefully not download _any_ objects but just gets the ALL branch and makes a merge commit in your working repository.

        
Previous: Michael K. EdwardsNext: Michael K. Edwards
Message 2 of 5 in “git fetch --reference?”
  1. Michael K. EdwardsNov 15, 2006
  2. Junio C HamanoNov 15, 2006
  3. Michael K. EdwardsNov 15, 2006
  4. Junio C HamanoNov 15, 2006
  5. Jakub NarebskiNov 15, 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.