From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2893 invoked by alias); 25 Apr 2010 08:51:36 -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: 27901 Received: (qmail 11114 invoked from network); 25 Apr 2010 08:51:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) 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.1 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: Re: vcs_info and locales In-Reply-To: <20100424234017.776ae0ea@coriolan> (=?utf-8?Q?=22Fran=C3=A7oi?= =?utf-8?Q?s?= Gannaz"'s message of "Sat, 24 Apr 2010 23:40:17 +0200") References: <20100424234017.776ae0ea@coriolan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Date: Sun, 25 Apr 2010 10:38:59 +0200 Message-ID: <87aassncyk.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: 430444 Fran=C3=A7ois Gannaz wrote: > As I installed my zsh prompt on another computer, vcs_info stopped workin= g for > svn repositories, it didn't print the branch nor the revision. It was just > because I had a french locale, and so vcs_info could not parse the output= of > "svn info". The locale had no effect on hg/git, but I didn't fully test t= hem. > > So I suggest either to fix the documentation or (better) fix the code. Yes, this could happen. Thanks for reporting. Obviously, fixing the code is the superior solution. However, I'd like to do it universally for all of `vcs_info' and not only for the invocation of "svn info". [...] > BTW, changing the command with: > zstyle ':vcs_info:svn:*:-all-' command "LC_ALL=3DC svn" > didn't work at all, and I don't understand why. The reason for that is because we're using the command roughly like this: ${command} ... And when sh_split_word isn't set (which it isn't by default and vcs_info uses mostly zsh defaults), the parameter isn't split, like it would in other bourne-like shells. I think it would be best to leave it as it is; but I don't feel strongly about it. If a lot be people think we should split that parameter, we could do that (even though it might break backwards compatibility for some people). Anyway, could you try the following patch for the locale problem? I think it should solve the issue once and for all. ---------- >8 ---------- >>From 66be07ae53e9af6e386ade123cc9a1450695c7bc Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sun, 25 Apr 2010 10:20:30 +0200 Subject: PATCH: vcs_info: Set LC_ALL locally MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This is to avoid problems with output from external commands with non-C locales as reported by Fran=C3=A7ois Gannaz in workers-27900. --- Functions/VCS_Info/vcs_info | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index a9e65e1..e9f782a 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -47,11 +47,12 @@ vcs_info () { local pat local -i found local -a enabled disabled dps - local -x usercontext vcs rrn + local -x usercontext vcs rrn LC_ALL local -ix maxexports local -ax msgs local -Ax vcs_comm =20 + LC_ALL=3DC vcs=3D'-init-'; rrn=3D'-all-' usercontext=3D${1:-default} =20 --=20 1.7.0