[darcs-users] deleting a repository

Frederik Eaton frederik at a5.repetae.net
Sun Aug 21 01:33:18 UTC 2005


On Sun, Aug 21, 2005 at 09:44:53AM +1000, Nigel Rowe wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Sun, 21 Aug 2005 08:00, Frederik Eaton wrote:
> > 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
> <snip/>
> > > >
> > > > 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. 
> 
> Not to mention that if 'a' and 'b' are on the same filesystem, mv and cp do 
> different things.  But thats not the topic at hand.
> 
> > 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. 
> 
> And quite often I want to close up a repository that *does* contain unique 
> information.  My workflow is quite often, get, hack, decide 'not a good 
> idea', rm.

Then maybe it would be useful to have a command which says "delete
this repository" and asks you if you want to push stuff and warns you
if there are remaining unpushed patches.

> > That operation should be built-in, 
> 
> maybe; that's what we're discussing
> 
> > and shouldn't  
> > require the user to invoke commands which potentially delete unique
> > information such as "rm -rf", which we think about differently.
> 
> in what way differently?  To me "get rid of repo that I don't want" is merely 
> a subset of "get rid of file or directory or tree that I don't want".

Really? I think about deleting information which is preserved
elsewhere rather differently from deleting information which is unique
but simply not needed. Hence mv instead of cp;rm. I like to save 'rm'
for the latter.

> > 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
> >
> 
> How about:
> (e) I think it's pointless (not useless), but if it scratches someone's itch, 
> go ahead and impliment it.  But, make it obvious in the docs that it's just a 
> convenience function for darcs push -a;rm -rf.
> 
> My problem with trivial convenience functions, is that they conceal the 
> underlying concepts.  Which increases the learning load, as it fails to 
> leverage existing knowledge.
> 
> ie.
> Q. How do I delete a repo?
> A. It's just a directory, rm it.
> 
> The important bit is "It's just a directory" which means everything known 
> about directories is now known to be applicable.

That's a good point. I think if the documentation mentioned that it
was pretty much composing two other operations, it wouldn't be a
problem though.

I still haven't thought of a good name. "release" is overloaded,
"delete" applies to files, etc.

Anyway, if it wouldn't be unwelcome then I (or someone else) may think
about implementing it. I've recently done an 'rsync' wrapper which
(among other things) deletes the source files on success to get a
pseudo-'remote move' functionality, and I've found it to be a bit more
useful to me than I'd expected.

Frederik





More information about the darcs-users mailing list