zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
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 14:03:13 +0200	[thread overview]
Message-ID: <87h9ywb9by.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <20141022105356.GB1692@tarsus.local2> (Daniel Shahaf's message of "Wed, 22 Oct 2014 10:53:56 +0000")

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


  reply	other threads:[~2014-10-22 12:04 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
2014-10-22 12:03       ` Frank Terbeck [this message]
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=87h9ywb9by.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=d.s@daniel.shahaf.name \
    --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).