Re: [PATCH 6/8] git-prompt: add fallback for shells without $'...'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 25, 2024, 16:19 UTC
- Message-ID
- <xmqqwml9igux.fsf@gitster.g>
- In-Reply-To
- <1106076396.2672924.1721906849141@mail.yahoo.com>
avih <avihpit@yahoo.com> writes:
> Generalized solution (without namespace-ification):
I think you are over-engineering this. We do not have immediate need for such facility to be used by other scripts. On the other hand, we know exactly what git-prompt wants to see available, and you already implemented them.
So just losing "make assignment asuming $'blah' works, and then reassign based on what printf gave us" and always using the printf thing is what we want to see here.
> assign_as_fmt \ > __git_SOH='\1' __git_STX='\2' __git_ESC='\33' \ > __git_LF='\n' __git_CRLF='\r\n'
Are you sure that everybody's implementation of printf(1) is happy with \d and \dd? I am an old timer who learnt in a distant past to always spell octals as \ddd without omitting any leading 0-digit, because some was unhappy.
Thanks.