You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Johan Corveleyn <jc...@gmail.com> on 2012/11/19 23:27:48 UTC

Re: [RFC]: Make svnlook (pg|pl) output format mimic svn (pg|pl) & add --show-inherited-props option

On Mon, Nov 19, 2012 at 9:04 PM, Paul Burba <pt...@gmail.com> wrote:
> Recently Johan proposed supporting multiple targets for svnlook
> propget: http://svn.haxx.se/dev/archive-2012-11/0439.shtml
>
> One of the ideas that came of this was to make the output of 'svnlook
> (pl|pg)' mimic the output of 'svn (pl|pg)'.  This dovetails nicely
> with my desire to add the ''show-inherited-props" option to svnlook
> (pl|pg): http://svn.haxx.se/dev/archive-2012-11/0432.shtml

+1 in general. Thanks for taking this on.

I have a couple of questions though ... see below.

> The question is, how far do we go with the backwards incompatible
> changes to the output of svnlook (pg|pl)? Here's what we have today
> (skip ahead to "PROPOSED CHANGES:" if you already know all this):
>
> ### svn proplist Today: ###
>
>>svn pl A\B
> Properties on 'A\B':
>   svn:auto-props
>   svn:global-ignores
>
>>svn pl A\B -v
> Properties on 'A\B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
>   svn:global-ignores
>     *.pyc
>
>>svn pl A\B --show-inherited-props
> Properties inherited from
> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>   svn:auto-props
> Properties on 'A\B':
>   svn:auto-props
>   svn:global-ignores

So this means that you don't show which node is actually the "target"
of these inherited props. What happens when you provide multiple
arguments ('svn pl A/B C/D --show-inherited-props')? Can a user see
(or a tool parse) which inherited props apply to which, or do they
have to depend on the order? What if one of the targets doesn't have
properties of its own (so no 'Properties on X' line), but does have
inherited props ... how will you know on which node they apply?

Maybe the output should become something like:

Properties on 'A\B' inherited from
'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
  svn:auto-props
Properties on 'A\B':
  svn:auto-props
  svn:global-ignores

?

The same applies to propget.

>>svn pl A\B --show-inherited-props -v
> Properties inherited from
> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>   svn:auto-props
>     *.py=svn:eol-style=native
>     *.cpp=svn:eol-style=native
>
> Properties on 'A\B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
>   svn:global-ignores
>     *.pyc
>
> ### svnlook proplist Today: ###
>
>>svnlook pl autoprop_tests-30 A/B
>   svn:global-ignores
>   svn:auto-props
>
>>svnlook pl autoprop_tests-30 A/B -v
>   svn:global-ignores : *.pyc
>
>   svn:auto-props : *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
> ### svn propget Today: ###
>
>>svn pg svn:auto-props ^^/A/B
> *.c=svn:eol-style=native
> *.h=svn:eol-style=native

Note that this output (without -v) changes when there are multiple targets:

>svn pg svn:auto-props A/B C/D
A/B - *.c=svn:eol-style=native
*.h=svn:eol-style=native

C/D - *.py=svn:eol-style=native
*.pl=svn:eol-style=native


Or with a single-line prop:

>svn pg svn:eol-style foo.txt bar.txt
foo.txt - native
bar.txt - native


This output isn't exactly great (not parseable for multiline props),
but it's okay for single-line props. In any case, we should also
define what this (multi-arg but without -v) looks like in the case of
'svnlook pg'.

>>svn pg svn:auto-props ^^/A/B -v
> Properties on 'file:///C:/SVN/src-trunk-2/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30/A/B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
>>svn pg svn:auto-props A\B --show-inherited-props
> . - *.py=svn:eol-style=native
> *.cpp=svn:eol-style=native
>
> A\B - *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
>>svn pg svn:auto-props A\B --show-inherited-props -v
> Properties inherited from '.':
>   svn:auto-props
>     *.py=svn:eol-style=native
>     *.cpp=svn:eol-style=native
>
> Properties on 'A\B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
> ### svnlook propget Today: ###
>
>>svnlook pg autoprop_tests-30 svn:auto-props A/B
> *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
> (svnlook pg -v is not currently supported)
>
> PROPOSED CHANGES:
>
> ### FORMAT CHANGE: 'svnlook pl' outputs results similar to 'svn pl':
>>svnlook pl autoprop_tests-30 A/B
> Properties on '/A/B':
>   svn:auto-props
>   svn:global-ignores
>
> ### FORMAT CHANGE: 'svnlook pl -v' outputs results like 'svn pl -v'
>>svnlook pl autoprop_tests-30 A/B -v
> Properties on '/A/B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>   svn:global-ignores
>     *.pyc
>
> ### NEW OPTION: Add support for 'svnlook pl --show-inherited-props'
> with output similar to 'svn pl --show-inherited-props':
>>svnlook pl autoprop_tests-30 A/B --show-inherited-props
> Properties inherited from '/':
>   svn:auto-props
> Properties on '/A/B':
>   svn:auto-props
>   svn:global-ignores
>
> ### NEW OPTION: As above, but with -v:
>>svnlook pl autoprop_tests-30 A/B --show-inherited-props -v
> Properties inherited from '/':
>   svn:global-ignores
>     *.pyc
> Properties on '/A/B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
> Properties on '/A/B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
> ### NO CHANGE: 'svnlook pg' stays the same:
>>svnlook pg autoprop_tests-30 svn:auto-props A/B
> *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
> ### NEW OPTION: Add support for 'svnlook pg -v' with output similar to
> 'svn pg -v':
>>svnlook pg autoprop_tests-30 svn:auto-props A/B -v
> Properties on '/A/B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
> ### NEW OPTION: Add support for 'svnlook pg --show-inherited-props'
> with output similar to 'svn pg --show-inherited-props':
>>svnlook pg autoprop_tests-30 svn:auto-props A/B --show-inherited-props
> . - *.py=svn:eol-style=native
> *.cpp=svn:eol-style=native
>
> A\B - *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
> ### As above, but with new -v option:
> svnlook pg autoprop_tests-30 svn:auto-props A/B --show-inherited-props -v
> Properties inherited from '/':
>   svn:auto-props
>     *.py=svn:eol-style=native
>     *.cpp=svn:eol-style=native
>
> Properties on '/A/B':
>   svn:auto-props
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
> So the only backwards incompatible changes we'd be making compared to
> 1.7 are for 'svnlook pl' and 'svnlook pl -v', everything else proposed
> above is the result of a new option.
>
> Is this acceptable?

Yep, looks fine to me.

-- 
Johan

Re: [RFC]: Make svnlook (pg|pl) output format mimic svn (pg|pl) & add --show-inherited-props option

Posted by Johan Corveleyn <jc...@gmail.com>.
On Tue, Nov 20, 2012 at 10:14 PM, Paul Burba <pt...@gmail.com> wrote:
> On Mon, Nov 19, 2012 at 5:27 PM, Johan Corveleyn <jc...@gmail.com> wrote:

...

>> Maybe the output should become something like:
>>
>> Properties on 'A\B' inherited from
>> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>>   svn:auto-props
>> Properties on 'A\B':
>>   svn:auto-props
>>   svn:global-ignores
>>
>> ?
>
> ...so something like your proceeding suggestion would be helpful.  I
> made such a change in r1411831 except I tweaked your wording just a
> bit so the line starts with "Inherited properties on" rather than
> "Properties on 'path'".  I think this makes it clearer at a glance
> when we are dealing with inherited vs. explicit properties.  For
> example:
>
>>svn pl --show-inherited-props B\Y\bar.c
> Inherited properties on 'B\Y\bar.c',
> from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
>   svn:auto-props
> Inherited properties on 'B\Y\bar.c',
> from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>   svn:auto-props
> Inherited properties on 'B\Y\bar.c',
> from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30\B':
>   svn:auto-props
> Properties on 'B\Y\bar.c':
>   svn:eol-style
>
>>svn pl --show-inherited-props B\Y\bar.c -v
> Inherited properties on 'B\Y\bar.c',
> from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
>   svn:auto-props
>     *.h=svn:eol-style=native
>
> Inherited properties on 'B\Y\bar.c',
> from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>   svn:auto-props
>     *.py=svn:eol-style=native
>     *.c=svn:eol-style=native
>     *.h=svn:eol-style=native
>
> Inherited properties on 'B\Y\bar.c',
> from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30\B':
>   svn:auto-props
>     *.c=svn:eol-style=CR
>     *.h=svn:eol-style=CR
>     *.py=svn:eol-style=CR
>
> Properties on 'B\Y\bar.c':
>   svn:eol-style
>     CR
>
>
> (Yes, we can bikeshed this as necessary :-)

That looks great to me, I like the color of that bikeshed :-). Thanks.

>
>> The same applies to propget.
>
> I assume you are speaking only of 'svn pg -v' here?

Yep.

> As you point out
> the limitations of 'svn pg' sans -v below.  As part of r1411830 I also
> tweaked the 'svn pg -v' output ...

Perfect.

...

>> Note that this output (without -v) changes when there are multiple targets:
>>
>>>svn pg svn:auto-props A/B C/D
>> A/B - *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>>
>> C/D - *.py=svn:eol-style=native
>> *.pl=svn:eol-style=native
>>
>>
>> Or with a single-line prop:
>>
>>>svn pg svn:eol-style foo.txt bar.txt
>> foo.txt - native
>> bar.txt - native
>>
>>
>> This output isn't exactly great (not parseable for multiline props),
>> but it's okay for single-line props.
>>
>> In any case, we should also
>> define what this (multi-arg but without -v) looks like in the case of
>> 'svnlook pg'.
>
> Just to be clear, I'm *not* planning on tackling multi-target support
> for 'svnlook pg|pl'.  I was only proposing that the output in the
> single target case mimic that of 'svn pg|pl'.

Okay, got it.

> I agree, the non-verbose output for 'svn pg' isn't very useful in some
> circumstances, not just multi-line props, but also with the multiple
> targets with the --show-inherited-props option, particularly when (as
> you pointed out above for 'svn pg') the targets themselves don't have
> explicit properties.  But we have easy workarounds: --xml and -v.  As
> for 'svnlook pg', soon it will have the --verbose option.  Perhaps
> that is sufficient?

Yes, it certainly is.

And if I would ever get around to multi-target support I can always
mimic 'svn pg' for this.

-- 
Johan

Re: [RFC]: Make svnlook (pg|pl) output format mimic svn (pg|pl) & add --show-inherited-props option

Posted by Paul Burba <pt...@gmail.com>.
On Mon, Nov 19, 2012 at 5:27 PM, Johan Corveleyn <jc...@gmail.com> wrote:
> On Mon, Nov 19, 2012 at 9:04 PM, Paul Burba <pt...@gmail.com> wrote:
>> Recently Johan proposed supporting multiple targets for svnlook
>> propget: http://svn.haxx.se/dev/archive-2012-11/0439.shtml
>>
>> One of the ideas that came of this was to make the output of 'svnlook
>> (pl|pg)' mimic the output of 'svn (pl|pg)'.  This dovetails nicely
>> with my desire to add the ''show-inherited-props" option to svnlook
>> (pl|pg): http://svn.haxx.se/dev/archive-2012-11/0432.shtml
>
> +1 in general. Thanks for taking this on.
>
> I have a couple of questions though ... see below.
>
>> The question is, how far do we go with the backwards incompatible
>> changes to the output of svnlook (pg|pl)? Here's what we have today
>> (skip ahead to "PROPOSED CHANGES:" if you already know all this):
>>
>> ### svn proplist Today: ###
>>
>>>svn pl A\B
>> Properties on 'A\B':
>>   svn:auto-props
>>   svn:global-ignores
>>
>>>svn pl A\B -v
>> Properties on 'A\B':
>>   svn:auto-props
>>     *.c=svn:eol-style=native
>>     *.h=svn:eol-style=native
>>
>>   svn:global-ignores
>>     *.pyc
>>
>>>svn pl A\B --show-inherited-props
>> Properties inherited from
>> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>>   svn:auto-props
>> Properties on 'A\B':
>>   svn:auto-props
>>   svn:global-ignores
>
> So this means that you don't show which node is actually the "target"
> of these inherited props. What happens when you provide multiple
> arguments ('svn pl A/B C/D --show-inherited-props')? Can a user see
> (or a tool parse) which inherited props apply to which, or do they
> have to depend on the order? What if one of the targets doesn't have
> properties of its own (so no 'Properties on X' line), but does have
> inherited props ... how will you know on which node they apply?

The ordering, as you imply, is useful if every target has explicit properties:

>svn pl --show-inherited-props T1, T2, ...

Properties inherited from T1's most distant WC-or-URL parent (if any)
Properties inherited from T1's 2nd most distant WC-or-URL parent (if any)
Properties inherited from T1's 3rd most distant WC-or-URL parent (if any)
.
.
Properties inherited from T1's immediate WC-or-URL parent (if any)
(Explicit) Properties on T1 (if any)
Properties inherited from T2's most distant WC-or-URLparent (if any)
Properties inherited from T2's 2nd most distant WC-or-URL parent (if any)
Properties inherited from T2's 3rd most distant WC-or-URL parent (if any)
.
.
Properties inherited from T2's immediate WC-or-URL parent (if any)
(Explicit) Properties on T2 (if any)
.
.

If some or none of the targets don't have explicit properties, then we
are left to parse the WC-or-URL parent path to check if it is a parent
of the target in question.  That's fine for a script/tool, but
certainly leaves a bit to be desired for human eyes...

> Maybe the output should become something like:
>
> Properties on 'A\B' inherited from
> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>   svn:auto-props
> Properties on 'A\B':
>   svn:auto-props
>   svn:global-ignores
>
> ?

...so something like your proceeding suggestion would be helpful.  I
made such a change in r1411831 except I tweaked your wording just a
bit so the line starts with "Inherited properties on" rather than
"Properties on 'path'".  I think this makes it clearer at a glance
when we are dealing with inherited vs. explicit properties.  For
example:

>svn pl --show-inherited-props B\Y\bar.c
Inherited properties on 'B\Y\bar.c',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
  svn:auto-props
Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30\B':
  svn:auto-props
Properties on 'B\Y\bar.c':
  svn:eol-style

>svn pl --show-inherited-props B\Y\bar.c -v
Inherited properties on 'B\Y\bar.c',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
  svn:auto-props
    *.py=svn:eol-style=native
    *.c=svn:eol-style=native
    *.h=svn:eol-style=native

Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30\B':
  svn:auto-props
    *.c=svn:eol-style=CR
    *.h=svn:eol-style=CR
    *.py=svn:eol-style=CR

Properties on 'B\Y\bar.c':
  svn:eol-style
    CR


(Yes, we can bikeshed this as necessary :-)

> The same applies to propget.

I assume you are speaking only of 'svn pg -v' here?  As you point out
the limitations of 'svn pg' sans -v below.  As part of r1411830 I also
tweaked the 'svn pg -v' output from this:

>svn pg svn:auto-props --show-inherited-props -v D D\G
Properties inherited from
'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Properties inherited from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Properties on 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Properties inherited from
'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Properties inherited from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Properties inherited from 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Properties on 'D\G':
  svn:auto-props
    *.txt=svn:eol-style=native

To this:

>svn pg svn:auto-props --show-inherited-props -v D D\G
Inherited properties on 'D',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Inherited properties on 'D',
from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Properties on 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Inherited properties on 'D\G',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Inherited properties on 'D\G',
from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Inherited properties on 'D\G',
from 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Properties on 'D\G':
  svn:auto-props
    *.txt=svn:eol-style=native

>>>svn pl A\B --show-inherited-props -v
>> Properties inherited from
>> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>>   svn:auto-props
>>     *.py=svn:eol-style=native
>>     *.cpp=svn:eol-style=native
>>
>> Properties on 'A\B':
>>   svn:auto-props
>>     *.c=svn:eol-style=native
>>     *.h=svn:eol-style=native
>>
>>   svn:global-ignores
>>     *.pyc
>>
>> ### svnlook proplist Today: ###
>>
>>>svnlook pl autoprop_tests-30 A/B
>>   svn:global-ignores
>>   svn:auto-props
>>
>>>svnlook pl autoprop_tests-30 A/B -v
>>   svn:global-ignores : *.pyc
>>
>>   svn:auto-props : *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>>
>> ### svn propget Today: ###
>>
>>>svn pg svn:auto-props ^^/A/B
>> *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>
> Note that this output (without -v) changes when there are multiple targets:
>
>>svn pg svn:auto-props A/B C/D
> A/B - *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
> C/D - *.py=svn:eol-style=native
> *.pl=svn:eol-style=native
>
>
> Or with a single-line prop:
>
>>svn pg svn:eol-style foo.txt bar.txt
> foo.txt - native
> bar.txt - native
>
>
> This output isn't exactly great (not parseable for multiline props),
> but it's okay for single-line props.
>
> In any case, we should also
> define what this (multi-arg but without -v) looks like in the case of
> 'svnlook pg'.

Just to be clear, I'm *not* planning on tackling multi-target support
for 'svnlook pg|pl'.  I was only proposing that the output in the
single target case mimic that of 'svn pg|pl'.

I agree, the non-verbose output for 'svn pg' isn't very useful in some
circumstances, not just multi-line props, but also with the multiple
targets with the --show-inherited-props option, particularly when (as
you pointed out above for 'svn pg') the targets themselves don't have
explicit properties.  But we have easy workarounds: --xml and -v.  As
for 'svnlook pg', soon it will have the --verbose option.  Perhaps
that is sufficient?

-- 
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba