]> git.ipfire.org Git - thirdparty/git.git/commit
git-prompt: don't use shell $'...'
authorAvi Halachmi (:avih) <avihpit@yahoo.com>
Tue, 20 Aug 2024 01:48:30 +0000 (01:48 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Aug 2024 15:28:18 +0000 (08:28 -0700)
commit29bcec82a67ebeec0c3eaf865a06e52cde8c589b
treec51f31f0f10bde034331d82a3dbc976c6577a7f6
parentb732e08671f037373f615a6d8509da2dbc476322
git-prompt: don't use shell $'...'

$'...' is new in POSIX (2024), and some shells support it in recent
versions, while others have had it for decades (bash, zsh, ksh93).

However, there are still enough shells which don't support it, and
it's cheap to use an alternative form which works in all shells,
so let's do that instead of dismissing it as "it's compliant".

It was agreed to use one form rather than $'...' where supported and
fallback otherwise.

shells where $'...' works:
- bash, zsh, ksh93, mksh, busybox-ash, dash master, free/net bsd sh.

shells where it doesn't work, but the new fallback works:
- all dash releases (up to 0.5.12), older versions of free/net bsd sh,
  openbsd sh, pdksh, all Schily Bourne sh variants, yash.

Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-prompt.sh