threads / discuss / 498

Locking the repository

Subject: Locking the repository

## tl;dr

2 messages between May 6, 2005 and May 6, 2005.

replies: 1people: 2as markdown or json

Thomas Glanzmann· May 6, 2005, 12:31 UTC · lore

Hello, I need a way to lock a repository for certain actions. What can I use to obtain this? Is there a way to use rsync for that? It should also be NFS-safe. Are there are any classic unix tools that I can use for this?

	Thomas
Linus Torvalds· May 6, 2005, 16:15 UTC · re: Thomas Glanzmann · lore

Re: Locking the repository

On Fri, 6 May 2005, Thomas Glanzmann wrote:
>
> I need a way to lock a repository for certain actions.

Nope - if you want to serialize something, you'll need to write your own serialization scripts. git doesn't care, because all the git operations should be totally lockless already. There just isn't any reason to lock as far as git is concerned, since the objects are immutable.

The only exception is the "index" file, where we don't want concurrect index updates. So that is handled by writers creating the new "index.lock" file first, and then when they are done, they rename it to "index".

		Linus

← back to recent threads