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

Re: Interest in locking mechanism?

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jan 12, 2010, 20:25 UTC
Message-ID
<32541b131001121225y3929d6cao437297f4f233f4e@mail.gmail.com>
In-Reply-To
<46a038f91001121133r62b3d748n38ca27234f18e960@mail.gmail.com>

On Tue, Jan 12, 2010 at 2:33 PM, Martin Langhoff <martin.langhoff@gmail.com> wrote:

Show 13 quoted lines
> 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.

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"
Previous: Edward Z. YangNext: Martin Langhoff
Message 10 of 11 in “Interest in locking mechanism?”
  1. Edward Z. YangJan 12, 2010
  2. B Smith-MannschottJan 12, 2010
  3. Edward Z. YangJan 12, 2010
  4. Tomas CarneckyJan 12, 2010
  5. Avery PennarunJan 12, 2010
  6. Edward Z. YangJan 12, 2010
  7. Avery PennarunJan 12, 2010
  8. Martin LanghoffJan 12, 2010
  9. Edward Z. YangJan 12, 2010
  10. Avery PennarunJan 12, 2010
  11. Martin LanghoffJan 12, 2010

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.