Thread (11 messages) flat view 11 messages, 5 authors, 2016-06-15

Re: Interest in locking mechanism?

From: Avery Pennarun <hidden>
Date: 2016-06-15 22:48:00

On Tue, Jan 12, 2010 at 2:33 PM, Martin Langhoff
[off-list ref] wrote:
On Tue, Jan 12, 2010 at 8:24 PM, Avery Pennarun [off-list ref] wrote:
quoted
really).  Just make a 'co' command that writes your username to
.filename.lock and chmods the file; then write a ci command that
checks the lockfile to make sure it's yours, deletes the lock file,
git commits it, and chmods the file back again.
Actually -- on the same track but even better: if you are using a
unixy system, you are likely to have all the users belong to a group,
and the files are editable by the group because they are rwx by group
members.

So write your own "git-lock" command that does "chmod g-w $@";
git-unlock reenables the group-writable bit. Done.
The trick is to track which user has the file checked out; you don't
want some random person to (accidentally) check in someone else's
file.  That's the whole point.  Of course, you can arrange for this
with some simple shell scripting.

I doubt ACLs are needed really.  RCS certainly works(1) fine without them.

Have fun,

Avery

(1) depending on your definition of "works"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help