From: Junio C Hamano <gitster@pobox.com>
To: Stefan Naewe <stefan.naewe@gmail.com>
Cc: spearce@spearce.org, git@vger.kernel.org
Subject: Re: [PATCH v2] completion: fix issue with process substitution not working on Git for Windows
Date: Wed, 26 Oct 2011 13:02:47 -0700 [thread overview]
Message-ID: <7vvcrb1py0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 1319656389-9515-1-git-send-email-stefan.naewe@gmail.com
Stefan Naewe <stefan.naewe@gmail.com> writes:
> 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 'here string'.
>
> Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Yuck, but I honestly shouldn't care about the yuckiness as this script is
inherently intimately dependent on bash anyway ;-).
> contrib/completion/git-completion.bash | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 8648a36..0b3d47e 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -110,6 +110,7 @@ __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 ')"
> while read key value; do
> case "$key" in
> bash.showupstream)
> @@ -125,7 +126,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 <<< "$output"
>
> # parse configuration values
> for option in ${GIT_PS1_SHOWUPSTREAM}; do
next prev parent reply other threads:[~2011-10-26 20:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=7vvcrb1py0.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
--cc=stefan.naewe@gmail.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).