git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Langhoff <martin.langhoff@gmail.com>
To: Avery Pennarun <apenwarr@gmail.com>
Cc: "Edward Z. Yang" <ezyang@mit.edu>, git <git@vger.kernel.org>
Subject: Re: Interest in locking mechanism?
Date: Tue, 12 Jan 2010 20:33:18 +0100	[thread overview]
Message-ID: <46a038f91001121133r62b3d748n38ca27234f18e960@mail.gmail.com> (raw)
In-Reply-To: <32541b131001121124u541de280na9184183d8704dc8@mail.gmail.com>

On Tue, Jan 12, 2010 at 8:24 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> 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.

For more arcane things, use ACLs. On Windows I am sure there is a
commandline tool to touch ACL bits.

hth,



m
-- 
 martin.langhoff@gmail.com
 martin@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

  reply	other threads:[~2010-01-12 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12 18:10 Interest in locking mechanism? Edward Z. Yang
2010-01-12 18:29 ` B Smith-Mannschott
2010-01-12 18:33   ` Edward Z. Yang
2010-01-12 18:37   ` Tomas Carnecky
2010-01-12 19:01 ` Avery Pennarun
2010-01-12 19:11   ` Edward Z. Yang
2010-01-12 19:24     ` Avery Pennarun
2010-01-12 19:33       ` Martin Langhoff [this message]
2010-01-12 19:43         ` Edward Z. Yang
2010-01-12 20:25         ` Avery Pennarun
2010-01-12 19:26     ` Martin Langhoff

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

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

  git send-email \
    --in-reply-to=46a038f91001121133r62b3d748n38ca27234f18e960@mail.gmail.com \
    --to=martin.langhoff@gmail.com \
    --cc=apenwarr@gmail.com \
    --cc=ezyang@mit.edu \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).