zsh-users
 help / color / mirror / code / Atom feed
* vcs_info on a hg repository with a git subrepository; actionformats works ok, formats does not
@ 2012-09-17 13:37 Ioannis Koutras
  2012-09-17 14:50 ` Frank Terbeck
  0 siblings, 1 reply; 11+ messages in thread
From: Ioannis Koutras @ 2012-09-17 13:37 UTC (permalink / raw)
  To: zsh-users

Dear all,

I am using zsh v5.0.0, mercurial v2.3.1 and git v1.7.12 on ArchLinux.

I have enabled and been using the vcs_info function for my prompt as following:

> autoload -Uz colors && colors
> autoload -Uz vcs_info
> zstyle ':vcs_info:*' enable git hg svn
> zstyle ':vcs_info:*' check-for-changes true
> zstyle ':vcs_info:*' get-revision true
> zstyle ':vcs_info:*' unstagedstr '!'
> zstyle ':vcs_info:hg*:*' branchformat "%b"
> zstyle ':vcs_info:hg*:*' hgrevformat "%r"
> zstyle ':vcs_info:hg*:*' get-unapplied true
> zstyle ':vcs_info:hg*:*' patch-format "mq(%g):%n/%c %p"
> zstyle ':vcs_info:hg*:*' nopatch-format "mq(%g):%n/%c %p"
> zstyle ':vcs_info:hg*' formats "(%s) [%i%u %b %m]"
> zstyle ':vcs_info:hg*' actionformats "(%s|%a) [%i%u %b %m]"
>
> local user_host="%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}"
> local current_dir="%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}"
> setopt PROMPT_SUBST
> precmd() { vcs_info }
> PROMPT='╭─${user_host} ${current_dir} %{$fg[green]%}${vcs_info_msg_0_}%{$reset_color%}
> ╰─%B$%b '

Generally this setup works well, there is just one case where it does
not, a mercurial repository with a git sub-repository. More
specifically, when no change has been done I get a prompt like this:

> (hg) [git --version ]

On the other hand, prompt is ok if there is a change, e.g.:

> (hg) [5! default ]

I have found out that %i is replaced by "git" and %b by "--version" in
formats, but in actionformats they seem to be properly replaced.

Apparently this is an issue of the formatting, but in previous
versions it was working. E.g. the same configuration works on another
PC with zsh v4.3.17, mercurial v2.0.2 and git v1.7.9.5. Any idea what
could be the problem?


Kind regards,

Yannis


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

end of thread, other threads:[~2012-09-17 20:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 13:37 vcs_info on a hg repository with a git subrepository; actionformats works ok, formats does not Ioannis Koutras
2012-09-17 14:50 ` Frank Terbeck
2012-09-17 15:02   ` Ioannis Koutras
2012-09-17 15:15     ` Frank Terbeck
2012-09-17 15:38       ` Ioannis Koutras
2012-09-17 16:01         ` Frank Terbeck
2012-09-17 16:06           ` Seth House
2012-09-17 16:33             ` Frank Terbeck
2012-09-17 16:57               ` Seth House
2012-09-17 19:53                 ` Seth House
2012-09-17 20:23                   ` Seth House

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