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:33 UTC
Message-ID
<Pine.LNX.4.58.0507131425080.17536@g5.osdl.org>
In-Reply-To
<20050713211106.GA12047@taniwha.stupidest.org>
On Wed, 13 Jul 2005, Chris Wedgwood wrote:
Show 5 quoted lines
> 
> I would however like to be able to hardlink more than just the
> _object_ directory --- hardlinking the source is quite nice too.
> Might that be considered safe?  (I'm of course assuming that editors
> do write + rename when saving their buffers).

Hmm.. I don't think it's necessarily wrong, although as you say, your editor had better DTRT. That said, even if your editor doesn't, at least you won't corrupt your git archive, although you might have surprising changes creep into the other side..

But I've not verified that every git program does the right thing...

Search-search-search.. Indeed: at least "git-apply" seems to modify the file in place. That may be the only one, though - and should be easily fixed by adding an "unlink()" (and make it use O_EXCL just to make it easy to grep to verify that we always use O_EXCL with O_WR.*).

entry.c should also add O_EXCL (it seems to already do the unlink).

Anybody want to go through and verify it? I think we should support hardlinked source trees if we can do so easily, and it _looks_ like we're pretty close..

		Linus
Previous: Chris WedgwoodNext: Chris Wedgwood
Message 10 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.