git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
To: Nicolas Pitre <nico@cam.org>
Cc: Tony Lindgren <tony@atomide.com>,
	git@vger.kernel.org, Matthias Urlichs <smurf@smurf.noris.de>
Subject: Re: [SCRIPT] cg-rpush & locking
Date: Wed, 1 Jun 2005 08:51:23 +0200	[thread overview]
Message-ID: <20050601065123.GA23358@cip.informatik.uni-erlangen.de> (raw)
In-Reply-To: <Pine.LNX.4.63.0505311914550.6500@localhost.localdomain>

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.

	Thomas

  reply	other threads:[~2005-06-01  6:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-31 19:00 [SCRIPT] cg-rpush & locking Tony Lindgren
2005-05-31 23:16 ` Nicolas Pitre
2005-06-01  6:51   ` Thomas Glanzmann [this message]
2005-06-01 16:55     ` Tony Lindgren
2005-06-02  2:58     ` Linus Torvalds
2005-06-02  6:39       ` Daniel Barkalow
2005-06-02  7:14         ` Matthias Urlichs
2005-06-02  7:32           ` Tony Lindgren
2005-06-02 10:04             ` Matthias Urlichs
2005-06-02 14:50             ` Linus Torvalds
2005-06-02 17:54               ` Tony Lindgren
2005-06-02 19:12               ` Daniel Barkalow
2005-06-02 19:15 ` Dan Holmsand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050601065123.GA23358@cip.informatik.uni-erlangen.de \
    --to=sithglan@stud.uni-erlangen.de \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    --cc=smurf@smurf.noris.de \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).