git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: "Eduardo R. D'Avila" <erdavila@gmail.com>
Cc: git@vger.kernel.org, felipe.contreras@gmail.com,
	artagnon@gmail.com, s.oosthoek@xs4all.nl, gitster@pobox.com
Subject: Re: [PATCH 4/4] git-prompt.sh: add missing information in comments
Date: Sat, 22 Jun 2013 15:40:26 +0200	[thread overview]
Message-ID: <20130622134026.GM20052@goldbirke> (raw)
In-Reply-To: <8fcf64a70e63761f3982e1be05be0a2bb1fb68bf.1371780085.git.erdavila@gmail.com>

On Thu, Jun 20, 2013 at 11:25:29PM -0300, Eduardo R. D'Avila wrote:
> Mention that the command below is needed for prompt
> in ZSH with PS1:
>   setopt PROMPT_SUBST
> 
> Make it clear that colored prompt is only available
> in PROMPT_COMMAND mode.
> 
> Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
> ---
> 5	4	contrib/completion/git-prompt.sh
>  contrib/completion/git-prompt.sh | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
> index 70515cc..3ab2a69 100644
> --- a/contrib/completion/git-prompt.sh
> +++ b/contrib/completion/git-prompt.sh
> @@ -13,10 +13,10 @@
>  #    3a) Change your PS1 to call __git_ps1 as
>  #        command-substitution:
>  #        Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
> -#        ZSH:  PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
> +#        ZSH:  setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
>  #        the optional argument will be used as format string.
> -#    3b) Alternatively, if you are using bash, __git_ps1 can be
> -#        used for PROMPT_COMMAND with two parameters, <pre> and
> +#    3b) Alternatively, if you are using Bash or ZSH, __git_ps1 can
> +#        be used for PROMPT_COMMAND with two parameters, <pre> and

The git-prompt script only supports bash and zsh, so that "if you are
using Bash or ZSH" part doesn't say much, does it?  Furthermore, zsh
doesn't have PROMPT_COMMAND but a similar facility.  So how about
something like this instead?

#    3b) Alternatively, __git_ps1 can be used for PROMPT_COMMAND in
#        Bash or for precmd in ZSH with two parameters, <pre> and


>  #        <post>, which are strings you would put in $PS1 before
>  #        and after the status string generated by the git-prompt
>  #        machinery.  e.g.
> @@ -78,7 +78,8 @@
>  #
>  # If you would like a colored hint about the current dirty state, set
>  # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
> -# the colored output of "git status -sb".
> +# the colored output of "git status -sb" and are available only when
> +# using __git_ps1 for PROMPT_COMMAND.

Likewise:

# using __git_ps1 for PROMPT_COMMAND or precmd.

>  
>  # __gitdir accepts 0 or 1 arguments (i.e., location)
>  # returns location of .git repo
> -- 
> 1.8.3.1.487.g28387b2
> 

      reply	other threads:[~2013-06-22 13:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21  2:25 [PATCH 0/4] git-prompt: cleaning and improvement Eduardo R. D'Avila
2013-06-21  2:25 ` [PATCH 1/4] t9903: add tests for git-prompt pcmode Eduardo R. D'Avila
2013-06-22 13:06   ` SZEDER Gábor
2013-06-22 16:32     ` Eduardo D'Avila
2013-06-23  7:39       ` Junio C Hamano
2013-06-24 16:21       ` SZEDER Gábor
2013-06-21  2:25 ` [PATCH 2/4] git-prompt.sh: refactor colored prompt code Eduardo R. D'Avila
2013-06-22 14:37   ` Øystein Walle
2013-06-22 16:45   ` Eduardo D'Avila
2013-06-23 14:51     ` SZEDER Gábor
2013-06-25  1:21       ` Eduardo R. D'Avila
2013-06-21  2:25 ` [PATCH 3/4] git-prompt.sh: do not print duplicate clean color code Eduardo R. D'Avila
2013-06-22 13:26   ` SZEDER Gábor
2013-06-21  2:25 ` [PATCH 4/4] git-prompt.sh: add missing information in comments Eduardo R. D'Avila
2013-06-22 13:40   ` SZEDER Gábor [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130622134026.GM20052@goldbirke \
    --to=szeder@ira.uka.de \
    --cc=artagnon@gmail.com \
    --cc=erdavila@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=s.oosthoek@xs4all.nl \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).