Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Fwd: locking mechanism

On Thu, Dec 19, 2013 at 10:01 AM, Gunnar Wagenknecht
<gunnar@xxxxxxxxxxxxxxx> wrote:
> ... EGit just
> needs to get smarter and detect and ongoing transaction and participate
> within it.
>

In my eyes that was one point we did wrong before. If you look at the
DirCache.lock() then you see that this method not only locks the index
file (by simply creating a index.lock file which tells other git-aware
applications that they should not write into the index file now) but
it also gives back another DirCache instance. One should use this
instance to build up a modified index. In this DirCache you can
add/remove/update as you like. If in the end you say commit on that
instance it will update the real index file and remove the .lock file
in one shot. By in Laurents example he locks the dircache low-level
but has no chance to tell the higher layers (e.g. IFile.delete()) to
use the new DirCache instance for modifications.


Back to the top