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

Re: [PATCH] '-p' shortcut to '--parents'

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-05-18 06:09:07 CEST

[Replying to your mail, but comments are general.]

Jared Hardy wrote:
> Don't let me stoke any fires here, but I wanted to mention that SVK
> has "-p" as an equivalent to "--parents", in both the cp and mv
> commands. It is so handy, I just scripted it in, so both commands use
> this flag by default. Is there ever a situation where a user wouldn't
> want non-existing parents to be created for them? It irks me that this
> isn't a default for mkdir as well. I would rather that happen, than
> see a useless error message any day. Perhaps the question should be
> "what flag do we use to turn the create-parents feature off?"
> In my opinion, design decisions that force the user to go through
> manual steps, when they can be done automatically based on available
> data, are obnoxious. I'm sure plenty of potential users are turned off
> of many shells, just for this reason.

Note that the functionality you describe now exists in trunk, it's just
a question of whether or not to add '-p' as a shortcut for '--parents'.

> On 5/17/07, Kamesh Jayachandran <kamesh@collab.net> wrote:
>> C. Michael Pilato wrote:
>> > Kamesh Jayachandran wrote:
>> >
>> >> [[[
>> >>
>> >> Provide '-p' shortcut for '--parents'.

I thought about this idea when writing the feature and decided not to
include '-p' initially. This discussion about shortcuts comes up
frequently, and we've been pretty (overly?) protective of the shortcut
space. I'd like to see what the usage is before we consume a shortcut
on it.

>> >> * subversion/svn/cl.h
>> >> (svn_cl__longopt_t): Remove 'svn_cl__parents_opt'.
>> >> * subversion/svn/main.c
>> >> (svn_cl__options): Register '-p' shortcut for '--parents'.
>> >> (svn_cl__cmd_table): Register '-p' to be the allowable parameter
>> to 'add',
>> >> 'copy', 'mkdir', 'move'.
>> >> (main): Set 'opt_state.parents' for '-p' switch too.
>> >>
>> >> Patch by: kameshj
>> >> ]]]
>> >>
>> >
>> > I thought about submitting this same patch myself because of the
>> obvious
>> > 'mkdir -p'. But 'copy' also takes --parents, and 'cp -p' means
>> something
>> > totally different. Alas, I'm not sure this merits the consumption of a
>> > short_opt.
>> >
>> >
>> <snip from man cp>
>> -p same as --preserve=mode,ownership,timestamps
>> </snip>
>> Subversion does not know ownership as such(left to external
>> authorization modules).
>> I am not sure copying timestamp(svn:date) makes sense?
>> We support 'executable' mode via versioned property which is copied
>> anyways.
>>
>> So expecting 'svn cp -p' to behave as 'cp -p' shows once ignorance about
>> subversion.
>>
>> I think here the goal is user experience(All these days I used mkdir -p,
>> and learnt the --parents equivalent only today.) not parity with
>> existing tools especially when one is not possible.

I agree that the purpose of this feature is to help the user. 'cp -p'
doesn't create parents like the proposed 'svn cp -p'. I think we're
doing the users a disservice if we confuse the meaning of '-p' in the
context of 'svn cp' and vanilla 'cp'.

Another question I've been thinking about is what the behavior of the
following should be (from within the greek tree):

mkdir X
mkdir X/Y
svn cp --parents iota X/Y/Z

Right now, it complains because Y isn't versioned. If a local copy or
move finds unversioned directories, should it just add them a la 'svn
add --parents'?

-Hyrum

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 18 06:07:17 2007

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

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