git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Edward D'Souza via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Edward D'Souza <edsouza@gmail.com>
Subject: [PATCH 1/1] git-prompt.sh: update shell variable instructions.
Date: Wed, 05 Jun 2019 08:06:07 -0700 (PDT)	[thread overview]
Message-ID: <0074d3da7ad402043d58ebb107435ce955a347f5.1559747165.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.255.git.gitgitgadget@gmail.com>

From: Edward D'Souza <edsouza@gmail.com>

Clarify the need to set variables like GIT_PS1_SHOWDIRTYSTATE before
"source ~/.git-prompt.sh" is executed in your shell init process.

If you set these preferences too late i.e. after .git-prompt.sh executes,
they will silently fail to take effect.

Signed-off-by: Edward D'Souza <edsouza@gmail.com>
---
 contrib/completion/git-prompt.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index c6cbef38c2..ab5bcc0fec 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -35,6 +35,11 @@
 #
 # The prompt status always includes the current branch name.
 #
+# The prompt can be customized by setting various shell variables
+# (GIT_PS1_SHOWDIRTYSTATE, GIT_PS1_SHOWSTASHSTATE, etc.), which are described
+# below. Make sure that these variables get set *before* the
+# "source ~/.git-prompt.sh" line from step 2 (above) runs.
+#
 # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
 # unstaged (*) and staged (+) changes will be shown next to the branch
 # name.  You can configure this per-repository with the
-- 
gitgitgadget

  reply	other threads:[~2019-06-05 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 15:06 [PATCH 0/1] Improve instructions around how to set git-prompt preference variables Edward D'Souza via GitGitGadget
2019-06-05 15:06 ` Edward D'Souza via GitGitGadget [this message]
2019-06-05 16:06   ` [PATCH 1/1] git-prompt.sh: update shell variable instructions SZEDER Gábor
2019-06-05 19:26     ` Edward D'Souza

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=0074d3da7ad402043d58ebb107435ce955a347f5.1559747165.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=edsouza@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 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 NNTP newsgroup(s).