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

Re: git clone ignores GIT_ALTERNATE_OBJECT_DIRECTORIES

From
BRBrian Ristuccia <brian@ristuccia.com>
Date
Jul 31, 2009, 12:55 UTC
Message-ID
<20090731125539.GX12813@osiris.978.org>
In-Reply-To
<7vab2maqeo.fsf@alter.siamese.dyndns.org>
On Thu, Jul 30, 2009 at 01:04:31PM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> Brian Ristuccia <brian@ristuccia.com> writes:
> 
> > Is this behavior intentional for some good reason I've overlooked, or have I
> > stumbled on a bug?
> 
> Most likely not a bug.
> 
> When you talk about "clone", you need to realize that there actually are
> two repositories (and two object databases) involved: cloned source and
> destination.
> 
> Which repository should GIT_ALTERNATE_OBJECT_DIRECTORIES affect?
> 

Whichever one git is currently working in. (Even if git picks the "wrong" repository, object f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 is still f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 regardless of which repo it appears in and the end result will be consistent).

My understanding after reading gitrepository-layout(5), git-fsck(1),  is
that the effect of listing a directory in GIT_ALTERNATE_OBJECT_DIRECTORIES
should be roughly the same as listing it in the .git/objects/info/alternates
of whatever repository git happens to be working on.
   
Show 6 quoted lines
> If you are making a clone from a remote over the network, and if you
> already have another local repository of a related project that has
> necessary objects, you may want to look at
> 
>     "git clone --reference"
> 

Yes, this does the right thing as I mentioned in my previous message. (Behind the scenes, it's setting up .git/objects/info/alternates). My question is why doesn't GIT_ALTERNATE_OBJECT_DIRECTORIES behave the same as .git/objects/info/alternatives in all cases?

-- 
Brian Ristuccia
brian@ristuccia.com
Previous: Junio C Hamano
Message 3 of 3 in “git clone ignores GIT_ALTERNATE_OBJECT_DIRECTORIES”
  1. Brian RistucciaJul 30, 2009
  2. Junio C HamanoJul 30, 2009
  3. Brian RistucciaJul 31, 2009

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.