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

Re: [SCRIPT] cg-rpush & locking

From
Tony Lindgren <tony@atomide.com>
Date
Jun 1, 2005, 16:55 UTC
Message-ID
<20050601165502.GB20936@atomide.com>
In-Reply-To
<20050601065123.GA23358@cip.informatik.uni-erlangen.de>
* Thomas Glanzmann <sithglan@stud.uni-erlangen.de> [050531 23:56]:
Show 21 quoted lines
> 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
Previous: Thomas GlanzmannNext: Linus Torvalds
Message 4 of 13 in “[SCRIPT] cg-rpush & locking”
  1. Tony LindgrenMay 31, 2005
  2. Nicolas PitreMay 31, 2005
  3. Thomas GlanzmannJun 1, 2005
  4. Tony LindgrenJun 1, 2005
  5. Linus TorvaldsJun 2, 2005
  6. Daniel BarkalowJun 2, 2005
  7. Matthias UrlichsJun 2, 2005
  8. Tony LindgrenJun 2, 2005
  9. Matthias UrlichsJun 2, 2005
  10. Linus TorvaldsJun 2, 2005
  11. Tony LindgrenJun 2, 2005
  12. Daniel BarkalowJun 2, 2005
  13. Dan HolmsandJun 2, 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.