[darcs-users] suggestion: allow 'add' to add parent directories automatically

David Roundy droundy at abridgegame.org
Sun Oct 31 11:23:08 UTC 2004


On Sun, Oct 31, 2004 at 02:58:54AM +0000, Mark Stosberg wrote:
> Sometimes when I try 'darcs add' on a file, it complains:
> 
> "parent directory 't/' isn't in the repo."
> 
> I would like a flag to tell darcs "I know. I mean it anyway. Please
> add any parent directories as needed". 

This is a bit of a pain to code.  Still, it's a good idea (and has been
suggested before).  The trouble is that add has to do a bit of work to make
sure the adds are legal, otherwise you can get nasty situations (such as
adding the file without adding its parent directory, or adding the file
*before* adding the parent directory, which is just as bad).  So I don't
really want to touch this code before 1.0.0.  If someone else wants to
implement this, I may merge it though, since I'm (for obvious reasons)
better able to find bugs in other peoples' code than in my own.

> I suggest:
> 
> -p --add-parents  Adds any parent directories necessary for add to succeed
> 
> The "-p" is named after "mkdir -p", for which it serves the same
> purpose.

I'm afraid -p isn't a good option, since -p is also used for --patch, and I
want to avoid reusing short options with different meanings.  However, I'd
be happy to have this behavior as the default with no new flags.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list