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

Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 13, 2005, 21:05 UTC
Message-ID
<Pine.LNX.4.58.0507131402210.17536@g5.osdl.org>
In-Reply-To
<20050713204458.GB11403@taniwha.stupidest.org>
On Wed, 13 Jul 2005, Chris Wedgwood wrote:
Show 12 quoted lines
> 
> The complexity I added was to deal with a situation where we have
> 
>   tree1/
> 	.git/HEAD -> refs/head/master
> 
> and I do "cp -Rl tree1 tree2" giving me:
> 
>   tree2/
> 	.git/HEAD -> refs/head/master
> 
>   and .git/refs/head/master is hardlinked between both trees.
AND THAT IS WRONG.

You shouldn't hardlink whole trees. Git will not guarantee that it breaks the links.

Right now, if you go a "git commit", and a number of other core git operations, it will use ">" to overwrite the HEAD. You're screwed.

Show 5 quoted lines
> > That is COW-safe, but the thing is, it's incredibly painful for many
> > other operations, and I won't guarantee that git in general is
> > always going to be COW-safe wrt all the git files.
> 
> What operations is this painful for?
Your script was tens of lines of code, and it was BUGGY.
And now you ask what it's painful for?
Guys, if you want to mess up code, the #1 rule is:
 - make complex code to handle insane situations
You're well on your way to do that.

Don't hardlink git trees. It's a bug to do so. It will eventually change the other git tree.

Hardlink git _object_ directories. That's a totally different thing.
		Linus
Previous: Chris WedgwoodNext: Chris Wedgwood
Message 8 of 15 in “cogito --- don't overwrite metadata files in place (breaks CoW use)”
  1. cogito --- don't overwrite metadata files in place (breaks CoW use)Chris Wedgwood, Jul 12, 2005
  2. Junio C HamanoJul 12, 2005
  3. Chris WedgwoodJul 13, 2005
  4. Matthias UrlichsJul 13, 2005
  5. Chris WedgwoodJul 13, 2005
  6. Linus TorvaldsJul 13, 2005
  7. Chris WedgwoodJul 13, 2005
  8. Linus TorvaldsJul 13, 2005
  9. Chris WedgwoodJul 13, 2005
  10. Linus TorvaldsJul 13, 2005
  11. Chris WedgwoodJul 13, 2005
  12. Matthias UrlichsJul 13, 2005
  13. Chris WedgwoodJul 13, 2005
  14. Linus TorvaldsJul 13, 2005
  15. Chris WedgwoodJul 13, 2005

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.