From: Michael J Gruber <git@drmicha.warpmail.net>
To: Kevin Ballard <kevin@sb.org>
Cc: Sebastien Douche <sdouche@gmail.com>,
Andrew Sayers <andrew-git@pileofstuff.org>,
git list <git@vger.kernel.org>
Subject: Re: Add colors to the prompt for status indicators
Date: Tue, 16 Nov 2010 11:43:09 +0100 [thread overview]
Message-ID: <4CE2603D.8080209@drmicha.warpmail.net> (raw)
In-Reply-To: <C43669C9-CD42-4D51-BFB9-567AAA422C06@sb.org>
Kevin Ballard venit, vidit, dixit 16.11.2010 10:07:
> On Nov 16, 2010, at 12:11 AM, Sebastien Douche wrote:
>
>> On Tue, Nov 16, 2010 at 00:14, Kevin Ballard <kevin@sb.org> wrote:
>>> I take it back. We can use PROMPT_COMMAND for this, to set up variables
>>> containing what you want.
>>>
>>> Something like the following should work:
>>
>> Hi Kevin,
>> good job! I looked the git prompt and I'm a bit disappointed with the
>> combination, ps1 can show many items:
>>
>> #
>> %
>> +
>> *
>> $
>> REBASE-i|
>> REBASE-m|
>> MERGING|
>> BISECTING|
>> < > <> (or u+count u-count u+countu-count)
>>
>> Each item is "optional", so you can have REBASE-i| with * and +, or
>> only *. It seems to complicated to wrap all items (I think of the
>> verbose mode for upstream branches). Maybe coding a lua (or Python)
>> prompt with a config file.
>
> In the end you need to stuff everything that needs a distinct color into its
> own shell variable. You could just extend the shell function that's doing that
> right now, or you could write a script in another language that emits a
> shell-quoted set of variables suitable for evaling by the shell.
Also, you should get away from parsing individual characters in
__git_ps1. Characters like + and - are valid in branch names. Coloring
them within the name is not quite intended.
I guess the only way is to produce colors within __git_ps1 (based on an
option). Also, colors would allow to use the same status letters as "git
status -s".
Michael
next prev parent reply other threads:[~2010-11-16 10:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-31 4:14 Add colors to the prompt for status indicators Sebastien Douche
2010-10-31 6:26 ` Kevin Ballard
2010-11-14 20:50 ` Andrew Sayers
2010-11-15 22:52 ` Kevin Ballard
2010-11-15 23:14 ` Kevin Ballard
2010-11-16 8:11 ` Sebastien Douche
2010-11-16 9:07 ` Kevin Ballard
2010-11-16 10:43 ` Michael J Gruber [this message]
2010-11-16 10:49 ` Kevin Ballard
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=4CE2603D.8080209@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=andrew-git@pileofstuff.org \
--cc=git@vger.kernel.org \
--cc=kevin@sb.org \
--cc=sdouche@gmail.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.