[darcs-users] deleting a repository

Frederik Eaton frederik at a5.repetae.net
Sat Aug 20 22:00:22 UTC 2005


On Sun, Aug 21, 2005 at 07:34:30AM +1000, Nigel Rowe wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Sun, 21 Aug 2005 02:32, Frederik Eaton wrote:
> > Hi,
> >
> > I've been looking for a sort of counterpart to 'darcs get' which
> > deletes a checked-out repository. The scenario is that I've checked
> > out a repository with 'darcs get', made some modifications, used
> > 'darcs push' to commit my changes, and now I want to delete the thing
> > that I checked out. It would be nice to have a single command which
> > checks that there is nothing in the directory which has not been
> > committed to the repository I am pushing to, and then deletes the
> > directory in a single step. The syntax might be 'darcs release
> > --repodir=THEDIR PARENT_REPO. This would first call 'darcs push';
> > then, if all the patches in THEDIR are also in PARENT_REPO, and there
> > are no extra (non-boring) files in THEDIR, it would delete THEDIR.
> > Does this make sense? I think it would be especially useful with darcs
> > because of the way darcs lets users manage multiple versions of the
> > same repository simultaneously - as a result you tend to get a lot of
> > repositories floating around and it would be nice to have a handy way
> > to clean them up.
> >
> > Frederik
> 
> Is there anything wrong with 'rm -rf repo'?

Yeah, the same thing that's wrong with 'cp -a a b; rm -rf a' - surely
you would use 'mv' instead. The reason you would do so is not just
that the latter is shorter but that the former is error prone. You
don't want to lose any information, yet if you perform the operation
as a sequence of copy and delete commands, bad things could happen.
You might fail to notice that the first command didn't succeed, or you
might fail to enter the source location correctly the second time. In
either case you could end up deleting something which only exists in
one place.

As for being shorter, yeah, I believe that we think about it as one
atomic operation. You want to close up a repository which contains no
unique information. That operation should be built-in, and shouldn't
require the user to invoke commands which potentially delete unique
information such as "rm -rf", which we think about differently.

What do you think?

(a) I think it's useless and shouldn't be part of darcs
(b) I wouldn't use it, but I would accept a patch
(c) I would use it, but I don't have time to implement it
(d) I would implement it

Cheers,

Frederik




More information about the darcs-users mailing list