On Wed, Feb 25, 2015 at 11:16 AM, Branko Čibej <brane_at_wandisco.com> wrote:
> 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.
Ah, but there is precedent for this (otherwise I wouldn't have come up
with the question :-)):
[[[
C:\>svn log -c 1662072 -c 1662177 http://svn.apache.org/repos/asf/subversion/
------------------------------------------------------------------------
r1662072 | brane | 2015-02-24 19:17:59 +0100 (di, 24 feb 2015) | 6 lines
On the svn-info-detail branch: Update help docs for 'svn info'.
* subversion/svn/svn.c
(svn_cl__cmd_table): Fix a typo and improve wording in the
help text of the 'info' command.
------------------------------------------------------------------------
r1662177 | brane | 2015-02-25 09:15:39 +0100 (wo, 25 feb 2015) | 1 line
On the reuse-ra-session branch: Sync with trunk up to r1662176.
------------------------------------------------------------------------
]]]
(or -c 1662072,1662177 works just as well).
I'm using this feature of 'svn log' (added in 1.6 I believe) from some
scripts, because it's a lot faster than invoking 'svn log' multiple
times if you have a set of revs.
> * 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.
Ack, it might be overkill. Just wanted to note / ask about the
possibility. And I guess such an extension, should one go for it, can
always be added later.
Thanks.
--
Johan
Received on 2015-02-25 11:51:44 CET