git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] completion: fix issue with process substitution not working on Git for Windows

From
Stefan Naewe <stefan.naewe@gmail.com>
Date
Oct 25, 2011, 18:01 UTC
Message-ID
<1319565695-5976-1-git-send-email-stefan.naewe@gmail.com>

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
Next: Johannes Sixt
Message 1 of 10 in “completion: fix issue with process substitution not working on Git for Windows”
  1. completion: fix issue with process substitution not working on Git for WindowsStefan Naewe, Oct 25, 2011
  2. Johannes SixtOct 25, 2011
  3. Stefan NäweOct 26, 2011
  4. completion: fix issue with process substitution not working on Git for WindowsStefan Naewe, Oct 26, 2011
  5. Junio C HamanoOct 26, 2011
  6. Junio C HamanoOct 26, 2011
  7. Stefan NäweOct 27, 2011
  8. SZEDER GáborOct 27, 2011
  9. Jonas BerlinOct 27, 2011
  10. Jonas BerlinOct 27, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.