[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[FEATURE REQUEST] svn mkdir -p, svn copy -p

From: Michael G Schwern <schwern_at_pobox.com>
Date: 2004-12-21 10:00:56 CET

This is a request for -p options to both mkdir and copy. I'm sure its not
the first (Issue #1776 is similar) but I want to add to the pile of requests.
I was quite astonished to find it not there.

For mkdir it would act exactly like Unix's mkdir, all necessary parent
directories will be necessary. For copy it would do the same, ensure all
parent directories are created.

Normally I'd assume the reasons would be obvious, but seeing as how SVN is
up to 1.1.1 I guess its not. The simplest is "principle of least
astonishment". SVN has a function called mkdir, therefore I expect it to
have the same basic properties as the shell mkdir. One of these is -p.
I'm sure there are clever ways to simulate mkdir -p but a user should not
have to be clever. SVN should take advantage of existing idioms where
possible to minimize what new idioms a user has to learn.

Here's some examples of things I've done and wished I had -p. They are all
at the level of "annoyance".

* Creating a tag or branch for the first time.

  svn cp svn://project/trunk svn://project/tags/Some-Tag

No tags directory. :( Now I have to...

  svn mkdir -m 'Directory for tags' svn://project/trunk svn://project/tags
  svn cp svn://project/trunk svn://project/tags/Some-Tag

Annoying.

* Creating several directories at once.

This example comes from making a new Perl module distribution. You make a
deep directory to hold your library files and a test directory.

  svn mkdir -p lib/Some/Module t

Can't do that. Now instead of one command I have to do four.

  svn mkdir lib
  svn mkdir lib/Some
  svn mkdir lib/Some/Module
  svn mkdir t

I'm sure there's some clever way to do this in two commands using "svn import"
but this is not something I should have to think about nor know some trick
to do.

Thank you for your time and thank you for Subversion.

PS It would be really nice if the issue tracker allowed readers to add
comments to issues such as "I would find this useful, too". Part of issue
tracking is knowing how important an issue is to the users. Right now
you're losing this information.

-- 
Michael G Schwern     schwern_at_pobox.com     http://www.pobox.com/~schwern/
If the enemy is in range, so are you.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 21 18:04:20 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.