git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: "David J. Malan via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	"David J. Malan" <malan@harvard.edu>
Subject: Re: [PATCH] git-prompt: changes == to = for zsh's sake
Date: Mon, 20 Jul 2020 20:23:09 -0400	[thread overview]
Message-ID: <20200721002309.GA178512@pug.qqx.org> (raw)
In-Reply-To: <pull.679.git.1595287052428.gitgitgadget@gmail.com>

At 23:17 +0000 20 Jul 2020, "David J. Malan via GitGitGadget" <gitgitgadget@gmail.com> wrote:
>From: "David J. Malan" <malan@harvard.edu>
>
>When using git-prompt.sh with Zsh, __git_ps1 currently errs
>when inside a repo with:
>
>__git_ps1:96: = not found

That depends if zsh's `equals` option is set or not. If it's set (as it 
is by default) you'll get that behavior. If it's unset (`setopt 
no_equals`) that should behave as in bash. But, it fixing the code to 
work regardless of shell options is definitely a good thing.

>This commit changes `==` to `=` for both Bash and Zsh.

An alternate fix would be to switch to using double square brackets 
instead of single square brackets for the test. Since contents of double 
brackets have their own parsing rules the `equals` option doesn't apply 
there, and so `==` is available for checking equality same as in bash.  
IMHO, this provides saner behavior in general; although it's definitely 
not POSIX compliant.

  parent reply	other threads:[~2020-07-21  0:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 23:17 [PATCH] git-prompt: changes == to = for zsh's sake David J. Malan via GitGitGadget
2020-07-20 23:58 ` Junio C Hamano
2020-07-21  0:40   ` Elijah Newren
2020-07-21  0:15 ` [PATCH v2] git-prompt: change " David J. Malan via GitGitGadget
2020-07-21  0:23 ` Aaron Schrab [this message]
2020-07-21  0:40   ` [PATCH] git-prompt: changes " 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=20200721002309.GA178512@pug.qqx.org \
    --to=aaron@schrab.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=malan@harvard.edu \
    --cc=newren@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).