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 33500
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] vcs_info: Use ‘command’ prefix to call version control programs
- Date: Wed, 22 Oct 2014 14:03:13 +0200
- Cc: zsh-workers@xxxxxxx, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Manfred Lotz <manfred.lotz@xxxxxxxx>
- In-reply-to: <20141022105356.GB1692@tarsus.local2> (Daniel Shahaf's message of "Wed, 22 Oct 2014 10:53:56 +0000")
- 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> <20141022105356.GB1692@tarsus.local2>
Hey Daniel,
Daniel Shahaf wrote:
> Frank Terbeck wrote on Wed, Oct 22, 2014 at 11:28:24 +0200:
[...]
>> 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:
No worries. Changing those lines took like five minutes. :)
> 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.)
I was afraid someone might say that. :)
> 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.)
That style could also be used to switch to a different binary, depending
on the current working copy. That's kind of what that style was
introduced for.
> - 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'd probably check whether $vcs is set. Although, someone else might use
that particular variable output of vcs_info, so I don't know.
> 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`.)
The problem is probably with the wrapper, rather than subversion. But
sure, I would be nice to know.
About resolving this issue, I'm fine either way. I think Daniel has a
point about setting the ‘command’ style, if you're using a wrapper
function that's incompatible with the usual behaviour of a backend's
external program.
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author