From: "Øyvind A. Holm" <sunny@sunbase.org>
To: git@vger.kernel.org, spearce@spearce.org
Subject: [PATCH] bash: Disable __git_ps1() if NO_GIT_PS1 is set
Date: Thu, 5 May 2011 00:11:53 +0200 [thread overview]
Message-ID: <20110504221153.GB15161@linode> (raw)
If the user works in a big repository on a slow USB disk or network
drive, __git_ps1() can result in a significant delay before the prompt
reappears. By setting the environment variable NO_GIT_PS1 to a nonempty
value, the use of __git_ps1() is temporarily disabled.
Signed-off-by: Øyvind A. Holm <sunny@sunbase.org>
---
contrib/completion/git-completion.bash | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0df356d..ee8cef5 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -60,6 +60,11 @@
# per-repository basis by setting the bash.showUpstream config
# variable.
#
+# When working in a big repository on a slow USB disk or network
+# drive, __git_ps1 may result in a noticeable delay before the prompt
+# reappears. To temporarily disable the use of __git_ps1, set
+# NO_GIT_PS1 to a nonempty value.
+#
#
# To submit patches:
#
@@ -225,6 +230,7 @@ __git_ps1_show_upstream ()
# returns text to add to bash PS1 prompt (includes branch name)
__git_ps1 ()
{
+ [ -z "$NO_GIT_PS1" ] || return
local g="$(__gitdir)"
if [ -n "$g" ]; then
local r=""
--
1.7.5.185.g0b9dee
next reply other threads:[~2011-05-04 22:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 22:11 Øyvind A. Holm [this message]
2011-05-05 17:48 ` [PATCH] bash: Disable __git_ps1() if NO_GIT_PS1 is set Stefan Haller
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=20110504221153.GB15161@linode \
--to=sunny@sunbase.org \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/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).