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

Re: svn info --show-item [was: svn info --detail]

From: Branko Čibej <brane_at_wandisco.com>
Date: Wed, 25 Feb 2015 11:16:55 +0100

On 25.02.2015 10:56, Johan Corveleyn wrote:
> On Tue, Feb 24, 2015 at 5:32 PM, Julian Foad <julianfoad_at_btopenworld.com> wrote:
>> Branko Čibej wrote:
>>> This is what's currently on the branch:
>>>
>>> svn diff http://svn.apache.org/repos/asf/subversion/trunk@1661975 \
>>> http://svn.apache.org/repos/asf/subversion/branches/svn-info-detail
>> [...]
>>> svn info --show-item=KEYWORD
>> Looks good to me.
>>
>>
>> I'm +1 on merging to trunk. I tried it out briefly and noted a few minor issues on IRC, none of which would need to be fixed before merging.
>>
>> I'd be happy for this to be ported into 1.9.0 too.
>>
> +1. Very nice feature.
>
> I've been wondering though (sorry, haven't read through the source,
> just thinking about how it works): does it support multiple
> --show-item options? As in:
>
> $ svn info --show-item=last-changed-rev
> --show-item=last-changed-author TARGET
> 12345
> johndoe
>
> I don't know how this would work together with multple (or recursive)
> targets, but maybe something like this might be okay:
>
> $ svn info --show-item=last-changed-rev
> --show-item=last-changed-author --depth=immediates .
> 12345 johndoe .
> 54321 jrandom README
> ...
>
> ?

No, it doesn't support multiple --show-item options. There are a several
reasons for that:

  * The first is a design decision from day one that we won't complicate
    the command-line client by supporting multiple instances of the same
    option. There's no code for that currently, although I think it
    should be possible to change the option parser to support that.
  * As you note, there are potential problems with the output format.
    Since --show-item is mainly intended to be used by simple scripts
    (the output is not translated, for example), allowing multiple
    values for one invocation would insanely complicate result parsing
    and we'd probably have to invent whitespace escaping for the values.
    This is already a potential problem with multiple targets.

I think that anyone who needs that level of control in a script should
just use the bindings and call svn_client_info() directly. After all,
calling 'svn info --show-item' several times isn't that hard, and not
appreciably slower for local paths.

-- Brane
Received on 2015-02-25 11:18:13 CET

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.