git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] completion: fix issue with process substitution not working on Git for Windows
@ 2011-10-25 18:01 Stefan Naewe
  2011-10-25 20:39 ` Johannes Sixt
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Naewe @ 2011-10-25 18:01 UTC (permalink / raw)
  To: spearce; +Cc: git, gitster, Stefan Naewe

Git for Windows comes with a bash that doesn't support process substitution.
It issues the following error when using git-completion.bash with
GIT_PS1_SHOWUPSTREAM set:

$ export GIT_PS1_SHOWUPSTREAM=1
sh.exe": cannot make pipe for process substitution: Function not implemented
sh.exe": cannot make pipe for process substitution: Function not implemented
sh.exe": <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n '): ambiguous redirect

Replace the process substitution with a simple "echo $var | while...".

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
---
 contrib/completion/git-completion.bash |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8648a36..926db80 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -110,6 +110,8 @@ __git_ps1_show_upstream ()
 	local upstream=git legacy="" verbose=""
 
 	# get some config options from git-config
+	output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
+	echo "$output" | \
 	while read key value; do
 		case "$key" in
 		bash.showupstream)
@@ -125,7 +127,7 @@ __git_ps1_show_upstream ()
 			upstream=svn+git # default upstream is SVN if available, else git
 			;;
 		esac
-	done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
+	done
 
 	# parse configuration values
 	for option in ${GIT_PS1_SHOWUPSTREAM}; do
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-10-27 10:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 18:01 [PATCH] completion: fix issue with process substitution not working on Git for Windows Stefan Naewe
2011-10-25 20:39 ` Johannes Sixt
2011-10-26  6:52   ` Stefan Näwe
2011-10-26 19:13     ` [PATCH v2] " Stefan Naewe
2011-10-26 20:02       ` Junio C Hamano
2011-10-26 21:07       ` Junio C Hamano
2011-10-27  6:26         ` Stefan Näwe
2011-10-27  9:05       ` SZEDER Gábor
2011-10-27 10:27         ` Jonas Berlin
2011-10-27 10:40           ` Jonas Berlin

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).