From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2446 invoked by alias); 22 Oct 2014 12:04:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33500 Received: (qmail 691 invoked from network); 22 Oct 2014 12:04:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 From: Frank Terbeck To: Daniel Shahaf Cc: zsh-workers@zsh.org, Bart Schaefer , Manfred Lotz Subject: Re: [PATCH] vcs_info: Use =?utf-8?B?4oCYY29tbWFuZOKAmQ==?= prefix to call version control programs In-Reply-To: <20141022105356.GB1692@tarsus.local2> (Daniel Shahaf's message of "Wed, 22 Oct 2014 10:53:56 +0000") References: <141021232256.ZM14769@torch.brasslantern.com> <1413970104-5500-1-git-send-email-ft@bewatermyfriend.org> <20141022105356.GB1692@tarsus.local2> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.94 (gnu/linux) Date: Wed, 22 Oct 2014 14:03:13 +0200 Message-ID: <87h9ywb9by.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: NDMwNDQ0 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. :) >>=20 > > 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 =3Dsvn > > (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 =E2=80=98command=E2=80=99 style, if you're using a = wrapper function that's incompatible with the usual behaviour of a backend's external program. Regards, Frank