From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "Shupak, Vitaly" <Vitaly.Shupak@deshaw.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: BUG: git prompt breaks with zsh < 5.0.6
Date: Mon, 9 Jan 2023 23:37:01 +0000 [thread overview]
Message-ID: <Y7ylHW8nrsT1eVtW@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <5807cdbe6d66427c9ff45ea78c2c1ffb@deshaw.com>
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
On 2023-01-09 at 17:12:56, Shupak, Vitaly wrote:
> A change to git-prompt.sh in v2.38 to show presence of unresolved conflicts contains syntax which is not valid under zsh < 5.0.6. This version of zsh is old, but is still the default on RedHat 7 machines, for example.
>
> The offending block is:
>
> local conflict="" # state indicator for unresolved conflicts
> if [[ "${GIT_PS1_SHOWCONFLICTSTATE}" == "yes" ]] &&
> [[ $(git ls-files --unmerged 2>/dev/null) ]]; then
> conflict="|CONFLICT"
> fi
>
> [[ $(command) ]] syntax doesn't work in older version of zsh and should use [[ -n "$(command)" ]] instead.
Does [ "$(command)" ] work? I would assume so, because that's in POSIX.
If so, that might also be a valid approach since it doesn't look like we
need the special behaviour of the double-bracket operator.
--
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
next prev parent reply other threads:[~2023-01-09 23:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 17:12 BUG: git prompt breaks with zsh < 5.0.6 Shupak, Vitaly
2023-01-09 23:37 ` brian m. carlson [this message]
2023-01-10 15:15 ` Shupak, Vitaly
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7ylHW8nrsT1eVtW@tapette.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=Vitaly.Shupak@deshaw.com \
--cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).