From: Frank Terbeck <ft@bewatermyfriend.org>
To: Manfred Lotz <manfred.lotz@arcor.de>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] vcs_info: Use ‘command’ prefix to call version control programs
Date: Wed, 22 Oct 2014 15:51:36 +0200 [thread overview]
Message-ID: <878uk8b4bb.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <20141022145453.5f25f831@hogwart.bsdlocal.net> (Manfred Lotz's message of "Wed, 22 Oct 2014 14:54:53 +0200")
Manfred Lotz wrote:
[...]
> I agree there are use-cases for a wrapper function. :-)
>
> Although in my case I could fix it easily in my function svn() because
> I always issue a debug message to stdout (in this case stderr would
> be better I have to admit) which makes normal parsing of the svn command
> fail if function svn gets called instead of command svn. After removing
> it all is fine now.
You can keep your function if you do this (as Daniel suggested):
zstyle ':vcs_info:svn:*' command =svn
This assumes, you have the EQUALS option set to make the =svn expansion
work (this is the default behaviour of zsh). You could otherwise do
this:
zstyle ':vcs_info:svn:*' command ${commands[svn]}
> Nevertheless, I think a wrapper function isn't illegal and shouldn't
> fail.
If you change its behaviour in incompatible ways, there is no way to
make this work while still allowing the use of wrapper functions within
vcs_info.
Either your wrapper behaves like the original program would for normal
program invocations or vcs_info always uses the command instead of any
functions that may be defined. You can't have it both ways.
Anyway. I think using an explicit ‘command’ style with incompatible
wrappers is the best way to ensure functionality as well as backwards
compatibility.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
prev parent reply other threads:[~2014-10-22 14: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
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 [this message]
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=878uk8b4bb.fsf@ft.bewatermyfriend.org \
--to=ft@bewatermyfriend.org \
--cc=manfred.lotz@arcor.de \
--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).