Re: newbie questions about git design and features (some wrt hg)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Narebski
Date: Wednesday, January 31, 2007 - 3:56 am

Theodore Tso wrote:


From (libc.info):

 -- Macro: int O_APPEND
     The bit that enables append mode for the file.  If set, then all
     `write' operations write the data at the end of the file, extending
     it, regardless of the current file position.  This is the only
     reliable way to append to a file.  In append mode, you are
     guaranteed that the data you write will always go to the current
     end of the file, regardless of other processes writing to the
     file.  Conversely, if you simply set the file position to the end
     of file and write, then another process can extend the file after
     you set the file position but before you write, resulting in your
     data appearing someplace before the real end of file.

I don't quote understand how that would help hg (Mercurial) to have
operations like commit, pull/fetch or push atomic, i.e. all or nothing.
In hg you have to update individual files (blobs buckets) storing delta
and perhaps full version, update manifest file (flat tree) and update
changelog (commit): what happens if for example there are two concurrent
operations trying to update repository, e.g. two push operations in parallel
(from two different developers), or fetch from cron and commit? What
happens if operation is interrupted (e.g. lost connection to network during
fetch)?

In git both situations result in some prune-able and fsck-visible crud in
repository, but repository stays uncorrupted, and all operations are atomic
(all or nothing).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: newbie questions about git design and features (some w ..., Jakub Narebski, (Wed Jan 31, 3:56 am)
Re: newbie questions about git design and features (some w ..., Simon 'corecode' Sch ..., (Thu Feb 1, 12:59 am)
Re: newbie questions about git design and features (some w ..., Johannes Schindelin, (Thu Feb 1, 3:09 am)
Re: newbie questions about git design and features (some w ..., Simon 'corecode' Sch ..., (Thu Feb 1, 3:15 am)
Re: newbie questions about git design and features (some w ..., Johannes Schindelin, (Thu Feb 1, 3:49 am)
Re: newbie questions about git design and features (some w ..., Simon 'corecode' Sch ..., (Fri Feb 2, 6:51 am)