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

Re: GIT_OBJECT_DIRECTORY

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 18, 2006, 18:47 UTC
Message-ID
<Pine.LNX.4.64.0604181139150.3701@g5.osdl.org>
In-Reply-To
<20060418182650.GB25688@wohnheim.fh-wedel.de>
On Tue, 18 Apr 2006, Jörn Engel wrote:
> 
> But it appears as if I could "cp -lr" the git tree and work with that.

That should work. I just personally fear cowlinks, because some things will edit the files in place, and then you're screwed.

I _think_ it should be ok for the .git subdirectory, but quite frankly, I'm not going to guarantee it. Also, you will break the cow-linking when you ever re-pack either the source or the destination, so you'd actually be _better_ off with something that does

	# clone the git directories by hand, no checkout (-n).
	git clone -l -s -n src dst
	# cow-link the checked-out state
	(cd src ; git ls-files | cpio -pudml dst)
	# make sure to refresh the index
	git update-index --refresh
or something like that.

TOTALLY UNTESTED!! (And you need to have made "dst" be an absolute path, of course, since we want it to work even after we've done the "cd src" thing).

		Linus
Previous: Jörn EngelNext: Jörn Engel
Message 7 of 12 in “GIT_OBJECT_DIRECTORY”
  1. Jörn EngelApr 18, 2006
  2. Linus TorvaldsApr 18, 2006
  3. Jörn EngelApr 18, 2006
  4. Sam RavnborgApr 18, 2006
  5. Linus TorvaldsApr 18, 2006
  6. Jörn EngelApr 18, 2006
  7. Linus TorvaldsApr 18, 2006
  8. Jörn EngelApr 18, 2006
  9. H. Peter AnvinApr 19, 2006
  10. Junio C HamanoApr 19, 2006
  11. Junio C HamanoApr 18, 2006
  12. Jörn EngelApr 18, 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.