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

Re: Darcs-git: a few notes for Git hackers

From
HAH. Peter Anvin <hpa@zytor.com>
Date
May 9, 2005, 22:50 UTC
Message-ID
<427FE938.7050904@zytor.com>
In-Reply-To
<7ipsw010i5.fsf@lanthane.pps.jussieu.fr>
Juliusz Chroboczek wrote:
Show 21 quoted lines
>>>I see.  Let me know if you decide to use a different name for the
>>>lock file so I can switch to using the same one as yours.
> 
> 
>>Are you using flock(), or some other contraption that breaks if a
>>process dies unexpectedly?
> 
> No, I'm using a file that is created by the NFS-safe equivalent of
> open(O_CREAT | O_EXCL).  This is what Darcs has been doing basically
> forever.
> 
> Darcs usually doesn't die unexpectedly -- it's a Haskell program, so
> bugs usually manifest themselves with an exception being thrown
> allowing Darcs to clean-up after itself.
> 
> The one exception is when Darcs gets killed by the OOM killer (which,
> as you doubtless know, doesn't give any advance warning to a process,
> thus making it impossible for a process to deal with it gracefully).
> In such cases, manual intervention is necessary anyway -- a file could
> have been written half-way.
> 

In the case of git, it should not be necessary even then; there might be a broken file in the repository but nothing would reference it so it shouldn't have any effect. Functionally speaking, operations on the git repository are in themselves atomic.

	-hpa
Previous: Juliusz ChroboczekNext: Juliusz Chroboczek
Message 6 of 12 in “Darcs-git: a few notes for Git hackers”
  1. Juliusz ChroboczekMay 9, 2005
  2. Petr BaudisMay 9, 2005
  3. Juliusz ChroboczekMay 9, 2005
  4. H. Peter AnvinMay 9, 2005
  5. Juliusz ChroboczekMay 9, 2005
  6. H. Peter AnvinMay 9, 2005
  7. Juliusz ChroboczekMay 9, 2005
  8. Brad RobertsMay 9, 2005
  9. Petr BaudisMay 9, 2005
  10. Junio C HamanoMay 9, 2005
  11. Brad RobertsMay 10, 2005
  12. Daniel BarkalowMay 10, 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.