From: Tony Lindgren Date: Wed, 01 Jun 2005 16:55:02 GMT Subject: Re: [SCRIPT] cg-rpush & locking Message-ID: <20050601165502.GB20936@atomide.com> In-Reply-To: <20050601065123.GA23358@cip.informatik.uni-erlangen.de> * Thomas Glanzmann [050531 23:56]: > Hello, > > > Why do you need a lock at all? > > > Just update your HEAD reference last when you push and get it first when > > you pull. > > consider the following scenario: Two people push at the same time. One > HEAD gets actually written, but both think that their changes got > upstream. Of course the 'upstream' tree is consitent, but incomplete. > That is why we need a lock. And the lock should be obtained before the > remote HEAD is retrieved, I think the following scenario is how to > handle it: > > 1. acquire remote lock > 2. get remote HEAD > 3. if remote HEAD is ahead (not included in our history) abort > and free lock. > 4. push objects > 5. update remote HEAD with local > 6. free remote lock. Yes, that's basically what the script does. We have several people committing patches. Tony