zsh-workers
 help / color / mirror / code / Atom feed
* Call git directly to bypass possible functions under the same name
@ 2016-02-04 21:00 Valni
  2016-02-04 21:19 ` Frank Terbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Valni @ 2016-02-04 21:00 UTC (permalink / raw)
  To: zsh-workers

Hopefully I have reached the right mailing list and posted a valid
question/issue.

---

I stumbled upon an issue today when creating a function which adds SSH
keys to an agent on demand. This function should (and does, in `zsh -f`)
only be called when git/ssh is used. The function also has the same name
as the program.

However, I use a zsh framework which depends on vcs_info, which causes
some issue (https://github.com/Eriner/zim/issues/30).

When git is called from vcs_info, it does not appear to call it
directly, so any definitions of it, such as a function, will take priority.

This results in the function (seen in the first post of the GitHub
issue) being called when any (or none at all) command is called, because
the framework checks if the current directory is used by git using vcs_info.

Could vcs_info be changed so that it calls git directly? Thus far, this
appears to be the cause of the issue.

Thanks in advance.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Call git directly to bypass possible functions under the same name
  2016-02-04 21:00 Call git directly to bypass possible functions under the same name Valni
@ 2016-02-04 21:19 ` Frank Terbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Terbeck @ 2016-02-04 21:19 UTC (permalink / raw)
  To: Valni; +Cc: zsh-workers

Valni wrote:
> Hopefully I have reached the right mailing list and posted a valid
> question/issue.

This would probably be better suited on the zsh-users list, but you're
in the right vicinity. :)

> ---
>
> I stumbled upon an issue today when creating a function which adds SSH
> keys to an agent on demand. This function should (and does, in `zsh -f`)
> only be called when git/ssh is used. The function also has the same name
> as the program.
>
> However, I use a zsh framework which depends on vcs_info, which causes
> some issue (https://github.com/Eriner/zim/issues/30).
>
> When git is called from vcs_info, it does not appear to call it
> directly, so any definitions of it, such as a function, will take priority.
>
> This results in the function (seen in the first post of the GitHub
> issue) being called when any (or none at all) command is called, because
> the framework checks if the current directory is used by git using vcs_info.
>
> Could vcs_info be changed so that it calls git directly? Thus far, this
> appears to be the cause of the issue.

We are not going to change the way that vcs_info works with respect to
this. If you got a wrapper that is incompatible with the way that git
works, use a "command" style to force the command used by vcs_info to
its full path name:

   % zstyle ':vcs_info:git:*:-all-' command =git


Regards, Frank


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-04 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04 21:00 Call git directly to bypass possible functions under the same name Valni
2016-02-04 21:19 ` Frank Terbeck

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).