Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] vcs_info: Use ‘command’ prefix to call version control programs
- X-seq: zsh-workers 33498
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] vcs_info: Use ‘command’ prefix to call version control programs
- Date: Wed, 22 Oct 2014 10:53:56 +0000
- Cc: zsh-workers@xxxxxxx, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Manfred Lotz <manfred.lotz@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= mesmtp; bh=MLMTipOX7bl3UvDvc6S+YYCs45Y=; b=Q5gJq73Gd10WgtsB/2BQD h6j//y7nYbjuK5TZdSTzMd0T0j+IVR/gwWUiOZBOuNmtjoJG+gietDwwqKJSeOzb pZHTmcd1mW7wY9wNlzm5e1aqwfHCuthf/ddMVA2re3/WySfilVVhp3PwBFDOs+ej odq2bT2188zW9YuBwfifxA=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= smtpout; bh=MLMTipOX7bl3UvDvc6S+YYCs45Y=; b=QdM32T59+sUW/BSzDEgM ZnYJILFqy3mnQGFfKIDoG+MNDXd63opQ/bSjRJvIBf3tDh1STsPRKk0onTXf64Tf gUxc2fuHbHPhQjgXx5gfcc+agVBc0IWZ6/Kq5FpmsyJ14HZcJQGipMsuJEDdHcBm mq76ewv3lBNdHhx+3gu54Gk=
- In-reply-to: <1413970104-5500-1-git-send-email-ft@bewatermyfriend.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <141021232256.ZM14769@torch.brasslantern.com> <1413970104-5500-1-git-send-email-ft@bewatermyfriend.org>
Frank Terbeck wrote on Wed, Oct 22, 2014 at 11:28:24 +0200:
> Bart Schaefer wrote:
> > On Oct 22, 6:24am, Manfred Lotz wrote:
> [...]
> > } VCS_INFO_get_data_svn:31: bad set of key/value pairs for associative
> > } array
> [...]
> > I suppose VCS_INFO_get_data_svn ought to use "command ${vcs_comm[cmd]}"
> > instead to bypass any such wrapper functions. There are around three
> > dozen places in Functions/VCS_Info/Backends/* that could similarly use
> > the "command" prefix if we want to support Manfred's style of use.
>
> This patch implements Bart's suggestion.
> ---
>
> I think this is reasonable. I hope, people don't count on
> wrapper functions to work to achieve some sort of sinister
> hack. :)
>
I hate to say this after you already wrote the patch, but:
There are legitimate use-cases for wrapper functions, and your patch
would break them. (For example, someone might use a wrapper function
to dispatch to a different svn binary depending on the working copy they
are in.)
Alternative solutions include:
- Asking people who write svn() functions that vcs_info cannot use to
set the 'command' style to /usr/local/bin/svn, e.g.,
zstyle ':vcs_info:svn:*' command =svn
(I assume most svn() wrapper functions out there are compatible with
vcs_info.)
- Patching the wrapper function to behave differently when invoked by
vcs_info. The different behaviour could be, for example, adding
--non-interactive or dispatching to /usr/local/bin/svn without any
wrapping logic. I'm not sure what the best way to detect "being
invoked by vcs_info" would be --- perhaps "[[ ! -t 1 ]]"?
I would also be interested in knowing what the specific problem was in
the interaction between the OP's wrapper and vcs_info. (And in the
value of `svn --version -q`.)
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author