From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Frank Terbeck <ft@bewatermyfriend.org>
Cc: zsh-workers@zsh.org, Bart Schaefer <schaefer@brasslantern.com>,
Manfred Lotz <manfred.lotz@arcor.de>
Subject: Re: [PATCH] vcs_info: Use ‘command’ prefix to call version control programs
Date: Wed, 22 Oct 2014 10:53:56 +0000 [thread overview]
Message-ID: <20141022105356.GB1692@tarsus.local2> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2014-10-22 11:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 4:24 VCS_INFO_get_data_svn:31: bad set of key/value pairs for associative array Manfred Lotz
2014-10-22 6:22 ` Bart Schaefer
2014-10-22 9:28 ` [PATCH] vcs_info: Use ‘command’ prefix to call version control programs Frank Terbeck
2014-10-22 10:53 ` Daniel Shahaf [this message]
2014-10-22 12:03 ` Frank Terbeck
2014-10-22 12:42 ` Aaron Schrab
2014-10-22 13:43 ` Frank Terbeck
2014-10-22 12:54 ` [PATCH] " Manfred Lotz
2014-10-22 13:51 ` Frank Terbeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141022105356.GB1692@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=ft@bewatermyfriend.org \
--cc=manfred.lotz@arcor.de \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).