From: Brandon Casey <bcasey@nvidia.com>
To: <gitster@pobox.com>
Cc: <git@vger.kernel.org>, Brandon Casey <drafnel@gmail.com>,
<szeder@ira.uka.de>
Subject: [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring"
Date: Wed, 21 Aug 2013 13:49:33 -0700 [thread overview]
Message-ID: <1377118173-23405-3-git-send-email-bcasey@nvidia.com> (raw)
In-Reply-To: <1377118173-23405-1-git-send-email-bcasey@nvidia.com>
From: Brandon Casey <drafnel@gmail.com>
This reverts commit 69a8141a5d81925b7e08cb228535e9ea4a7a02e3.
Old Bash (3.0) which is distributed with RHEL 4.X and other ancient
platforms that are still in wide use, does not have a printf that
supports -v. Let's revert this patch and go back to using printf
in the traditional way.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
contrib/completion/git-prompt.sh | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index a81ef5a..7698ec4 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -433,11 +433,7 @@ __git_ps1 ()
local gitstring="$c${b##refs/heads/}${f:+$z$f}$r$p"
if [ $pcmode = yes ]; then
- if [[ -n ${ZSH_VERSION-} ]]; then
- gitstring=$(printf -- "$printf_format" "$gitstring")
- else
- printf -v gitstring -- "$printf_format" "$gitstring"
- fi
+ gitstring=$(printf -- "$printf_format" "$gitstring")
PS1="$ps1pc_start$gitstring$ps1pc_end"
else
printf -- "$printf_format" "$gitstring"
--
1.8.4.rc0.2.g6cf5c31
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
next prev parent reply other threads:[~2013-08-21 20:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 20:49 [PATCH 1/3] git-completion.bash: use correct Bash/Zsh array length syntax Brandon Casey
2013-08-21 20:49 ` [PATCH 2/3] t9902-completion.sh: old Bash still does not support array+=('') notation Brandon Casey
2013-08-21 20:49 ` Brandon Casey [this message]
2013-08-21 21:47 ` [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring" Junio C Hamano
2013-08-21 22:08 ` Brandon Casey
2013-08-22 0:22 ` Junio C Hamano
2013-08-22 0:33 ` Brandon Casey
2013-08-22 1:17 ` [PATCH] contrib/git-prompt.sh: handle missing 'printf -v' more gracefully Brandon Casey
2013-08-22 1:39 ` Brandon Casey
2013-08-22 1:27 ` [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring" Junio C Hamano
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=1377118173-23405-3-git-send-email-bcasey@nvidia.com \
--to=bcasey@nvidia.com \
--cc=drafnel@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=szeder@ira.uka.de \
/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).