[darcs-users] Small suggestion: lock/unlock and minor idiot-proofing
bruce at andrew.cmu.edu
Tue Nov 23 07:23:43 UTC 2004
I was thinking more along the lines of: You explicitly are not able to
push, or have other people pull from you, until you've run "darcs
unlock" or "darcs public". You could of course implicitly unlock on a
push, or maybe ask the user "I need to unlock the repo to to push". I
think that is what you are suggesting. You are right that "darcs pull"
when you are working in a locked repository should be ok. You shouldn't
be able to pull from someone else's repo that is locked however, since
that's the whole point.
Ketil Malde wrote:
>>since "darcs unrecord" is dangerous for possibly public changes, how
>>about adding a "darcs lock" command that makes a lockfile, so that you
>>can't pull from that repository (or maybe requiring --force to be
>>specified). Then you don't need to worry about
>>record/unrecord/rerecord while it is locked. When you are done, just
>>"darcs unlock" and people can start pulling from you. It also should
>>not allow "darcs push" so newbies like me don't accidentally share
>>something. This seems quite easy to implement by simply creating a
>>_darcs/lock file, and having pulls etc check for that file first.
>"lock" is a bit non-descriptive. How about "private"?
>I would think it would be natural to allow push and send, as you need
>some way out of the repo -- perhaps the lock file could contain
>information about the last (or set of) distributed patch(es), and
>disallow unrecord et al. for anyting already distributed?
I chose lock since that's what some other SCMs use for files that other
people can't modify outside of the lock owner. In a distributed SCM the
best you can do is keep your own stuff locked if you don't want other
people to get it. Of course the name isn't that important, so I guess
whoever implements it gets to name it ;)
Recording which patches have been pulled is a bit hard due to read-only
access or file permissions. BitKeeper, for example, needs permissions
to lock the repository during a pull, and its a nightmare with the usual
Unix file permissions when tunelling over ssh. I vastly prefer an SCM
that can work with only read-only access, although this does lead to the
question of what happens is someone does a "darcs pull" from my repo
while I'm running "darcs record". I'm assuming it optimistically
assumes non-parallel operations, but can detect and recover from such
corruption when it exists. Or maybe its just really optimistic, since
for most projects, the fraction of time repos are in the middle of an
operation is minuscule.
>>>Rule number one of working with darcs: never do anything interesting
>>>when "darcs what" doesn't say ``no changes''.
>>Why not just have those commands say "you have local changes, commit
More information about the darcs-users