[darcs-users] deleting a repository

David Roundy droundy at darcs.net
Mon Aug 22 14:29:29 UTC 2005


Hi all,

I agree with the apparent majority that "darcs release" seems like a rather
specialized and potentially confusing command.  I also agree with Erik that
when a user makes a feature request, it usually points out an actual
problem, even if the suggested solution isn't ideal.

In this case, the problem is one of how to "safely" delete a repository,
without worries that it contains "interesting" information.  I know I've
run into this myself, as I tend to have a lot of repositories at work
containing probably (but not certainly) dead-end codings, but some of them
have only stuff that I've already pushed.

There are a few ways one can handle such a scenario.  One is to push
everything before deleting the repository, another is a deletion command
that aborts with a nice message if there are unpushed (or unrecorded)
changes.  Another would be to use send to create a patch bundle of unpushed
changes before deleting the repository.

I think it would be nicest to first work out the interface by writing
scripts to do this.  If darcs push --dry-run doesn't return an appropriate
exit code indicating if there was anything to push (and I'm not sure what
ti does, although I could look it up), I'd say that's a bug that needs
fixing, as darcs ought to be scriptable.  It may be that we'll eventually
need a command-line flag to determine whether nothing to push is an error.

If we were to implement a darcs command to do this sort of work (which I
don't think is a good idea), I think "retire" might be nice name.  In which
case we could have various retirement options...

Another (perhaps foolish) idea would be to introduce scripts as pluggable
darcs commands, so users could customize their darcs by sticking a script
as ~/.darcs/commands/retire.  It would be an interesting challenge, working
out an interface that allows a command to behave like a "real" darcs
command.

As far as the question of deleting the repository directory itself (and the
"working directory" issues) I think we could perhaps just delete the
contents and require the user to run rmdir, which is a bit ugly, but very
safe, since rmdir is itself a "safe" command.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-users mailing list