From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eduardo R. D'Avila" Subject: [PATCH v2 5/5] git-prompt.sh: add missing information in comments Date: Wed, 26 Jun 2013 00:05:17 -0300 Message-ID: <06da7dd706334feb1ce04bea8e1c494a7a0797c1.1372211661.git.erdavila@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: =?UTF-8?q?SZEDER=20G=C3=A1bor?= , gitster@pobox.com, "Eduardo R. D'Avila" To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Jun 26 05:09:16 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Urg6c-0006S6-5K for gcvg-git-2@plane.gmane.org; Wed, 26 Jun 2013 05:09:14 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356Ab3FZDJK convert rfc822-to-quoted-printable (ORCPT ); Tue, 25 Jun 2013 23:09:10 -0400 Received: from mail-ye0-f171.google.com ([209.85.213.171]:50214 "EHLO mail-ye0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051Ab3FZDJI (ORCPT ); Tue, 25 Jun 2013 23:09:08 -0400 Received: by mail-ye0-f171.google.com with SMTP id q14so542619yen.30 for ; Tue, 25 Jun 2013 20:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=iRaCVVqYV7OToRRRnpJMdtO9MTe6olMJw4JQLCwdYrk=; b=w5svOMRV7bKcfFV3AX2XtZ4zicp8QbpQTrbZRv1artr3naXGuUNLQd631r/nCQw1uh bh+8KIul6TBViSTOdyQK5uvCC3q7puk7krRSQgDuKTBypRmvpK9JIPI4x6CfrGjUccbe E5WlrbjbgM/rwvNHTF/rN2/0vUgbKDm5sqAetB2JAAUvjLgXY8DiElC2CGe4RKJv61cE QAJSFGfHJRdH6vqcETJ5tBfAknyTCKe5e/jJ05ixzZINCBxkmkLNmtx44SEGzZk2vdXW kewWkZay+I0fk6PMosRTxglhJwR+CEwTY0zbLIgF0ayMinr9I4pQNCyc7f2HQkKiJ1Xb SjDQ== X-Received: by 10.236.37.38 with SMTP id x26mr1009035yha.123.1372216148306; Tue, 25 Jun 2013 20:09:08 -0700 (PDT) Received: from localhost.localdomain (200.175.80.235.dynamic.adsl.gvt.net.br. [200.175.80.235]) by mx.google.com with ESMTPSA id y70sm42415518yhe.15.2013.06.25.20.09.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Jun 2013 20:09:07 -0700 (PDT) X-Mailer: git-send-email 1.8.3.1.590.g42a98dd In-Reply-To: In-Reply-To: References: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Mention that the command below is needed for prompt in ZSH with PS1: setopt PROMPT_SUBST Rephrase some parts that mention only the "current branch name" being displayed in the prompt. Replace it by stating that the "repository status" is displayed. Make it clear that colored prompt is only available in PROMPT_COMMAND/precmd mode. With-suggestions-by: SZEDER G=C3=A1bor Signed-off-by: Eduardo R. D'Avila --- 15 11 contrib/completion/git-prompt.sh contrib/completion/git-prompt.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-= prompt.sh index 545518a..b3f39e8 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -3,7 +3,7 @@ # Copyright (C) 2006,2007 Shawn O. Pearce # Distributed under the GNU General Public License, version 2.0. # -# This script allows you to see the current branch in your prompt. +# This script allows you to see repository status in your prompt. # # To enable: # @@ -13,24 +13,27 @@ # 3a) Change your PS1 to call __git_ps1 as # command-substitution: # Bash: PS1=3D'[\u@\h \W$(__git_ps1 " (%s)")]\$ ' -# ZSH: PS1=3D'[%n@%m %c$(__git_ps1 " (%s)")]\$ ' +# ZSH: setopt PROMPT_SUBST ; PS1=3D'[%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,
 and
+#    3b) Alternatively, __git_ps1 can be used for PROMPT_COMMAND in
+#        Bash or for precmd() in ZSH with two parameters, 
 and
 #        , which are strings you would put in $PS1 before
 #        and after the status string generated by the git-prompt
 #        machinery.  e.g.
 #        Bash: PROMPT_COMMAND=3D'__git_ps1 "\u@\h:\w" "\\\$ "'
+#          will show username, at-sign, host, colon, cwd, then
+#          various status string, followed by dollar and SP, as
+#          your prompt.
 #        ZSH:  precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
-#        will show username, at-sign, host, colon, cwd, then
-#        various status string, followed by dollar and SP, as
-#        your prompt.
+#          will show username, pipe, then various status string,
+#          followed by colon, cwd, dollar and SP, as your prompt.
 #        Optionally, you can supply a third argument with a printf
 #        format string to finetune the output of the branch status
 #
-# The argument to __git_ps1 will be displayed only if you are currentl=
y
-# in a git repository.  The %s token will be the name of the current
-# branch.
+# The repository status will be displayed only if you are currently in=
 a
+# git repository. The %s token is the placeholder for the shown status=
=2E
+#
+# The prompt status always includes the current branch name.
 #
 # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
 # unstaged (*) and staged (+) changes will be shown next to the branch
@@ -78,7 +81,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 or precmd.
=20
 # __gitdir accepts 0 or 1 arguments (i.e., location)
 # returns location of .git repo
--=20
1.8.3.1.590.g42a98dd