Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: what is the effect of a percentage sign (%) as last character on the command line
- X-seq: zsh-workers 27636
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Peter <vmail@xxxxxxxxxxxxx>
- Subject: Re: what is the effect of a percentage sign (%) as last character on the command line
- Date: Sun, 24 Jan 2010 11:58:58 +0100
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <4B5C180D.8080904@xxxxxxxxxxxxx> (Peter's message of "Sun, 24 Jan 2010 10:51:09 +0100")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <4B582F3C.2010709@xxxxxxxxxxxxx> <100121080540.ZM21444@xxxxxxxxxxxxxxxxxxxxxx> <4B58AB3A.7050300@xxxxxxxxxxxxx> <2d3b879b1001211336m5b78982au96f267ea472af43d@xxxxxxxxxxxxxx> <4B58D35D.1050208@xxxxxxxxxxxxx> <100121182713.ZM21821@xxxxxxxxxxxxxxxxxxxxxx> <4B597061.10701@xxxxxxxxxxxxx> <100123155239.ZM27228@xxxxxxxxxxxxxxxxxxxxxx> <4B5C180D.8080904@xxxxxxxxxxxxx>
Peter writes:
> Yes, sorry , my snippet was too short:
>
> git_info() {
> ref=$(git symbolic-ref -q HEAD 2>/dev/null)
> ref=${ref#refs/heads}
> echo ${ref:+"${GREEN}[$ref]${WHITE}"}
[...]
Since you're trying to collect information from version control systems,
if you're on zsh 4.3.7 or newer, zsh includes a collection of functions
called `vcs_info' which do all the work for you. The thing is pretty
configurable, so tweaking it to your liking shouldn't be an issue.
It has support for a great number of version control systems; git is
among them (and the git backend is probably the one with the most
features).
If `vcs_info' is included in your zsh version, this should get you to
its documentation:
% MANPAGER='less -M -p GATHER' man zshcontrib
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author