You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michael G Schwern <sc...@pobox.com> on 2004/12/21 09:00:56 UTC

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

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@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

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

Posted by Michael G Schwern <sc...@pobox.com>.
On Wed, Dec 22, 2004 at 11:38:50AM +0530, S.Ramaswamy wrote:
> The '-p' option should work with both URLs and wc paths, Correct ?

I don't see any reason to make a distinction.  So yes, correct.


-- 
Michael G Schwern     schwern@pobox.com     http://www.pobox.com/~schwern/
I'm crazy but I get the job done.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by "S.Ramaswamy" <ra...@collab.net>.
On Tue, 2004-12-21 at 14:30, Michael G Schwern wrote:
> 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 Pilato's update to issue #1776 seems to indicate that
intermediate directories should be created by 'svn mkdir', 'svn copy',
and 'svn move', when '-p' is used. That would take care of most of your
annoyances, when it is implemented. I started working on it , but never
got around to finishing it. The '-p' option should work with both URLs
and wc paths, Correct ?


> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

commenting on issues (was: Re: [FEATURE REQUEST] svn mkdir -p, svn copy -p)

Posted by Benjamin Pflugmann <be...@pflugmann.de>.
Hi!

On Tue 2004-12-21 at 04:00:56 -0500, you wrote
[...]
> 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.

Create a login on the website an request the "Observer" role (which
doesn't have any special requirements... just wait until it's
approved).

Bye,

	Benjamin.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org