Skip to contentSkip to conversation

lock

DISCUSSION Paolo Teti 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

Paolo Teti

author
#0 lore raw

Just a question probably stupid because I'm a quite new GIT user.

Is possible to apply a lock (as in ClearCase) on a given file etc in order to prevent accidental check-out or any other tool operation?

Pao

#1 lore raw

Dear diary, on Fri, Nov 11, 2005 at 05:31:31PM CET, I got a letter where Paolo Teti <[email protected]> said that...

Quoted 4 lines

Just a question probably stupid because I'm a quite new GIT user.

Is possible to apply a lock (as in ClearCase) on a given file etc in order to prevent accidental check-out or any other tool operation?

Can you be a bit more detailed in the description of what do you exactly want?

Do you want to lock the file so that noone else will be able to check it out? That's impossible from GIT's very nature of distributed version control system.

Do you want to lock the file in your working copy so that you won't be able to remove it or change it? In that case, this is possible, but not implemented yet. Part of the solution would involve making the file read-only, the rest would be probably to make sure all the tools handle that case gracefully.

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
author
#2 lore raw

2005/11/11, Petr Baudis <[email protected]>:

Quoted 3 lines

Do you want to lock the file so that noone else will be able to check it out? That's impossible from GIT's very nature of distributed version control system.

No! I know that is impossible using GIT

Quoted 5 lines

Do you want to lock the file in your working copy so that you won't be able to remove it or change it? In that case, this is possible, but not implemented yet. Part of the solution would involve making the file read-only, the rest would be probably to make sure all the tools handle that case gracefully.

Yes! this is my case.. The as work-around I can use an hook (i.e. a kind of ClearCase trigger). But remain a work-around!

#3 lore raw
In reply to Paolo Teti

Hi,

Quoted 2 lines · Paolo Teti

Is possible to apply a lock (as in ClearCase) on a given file etc in order to prevent accidental check-out or any other tool operation?

You should be able to do that with a hook (see Documentation/hooks.txt).

Hth,
Dscho