Re: \b character escapes in CLI usage
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Feb 27, 2025, 16:26 UTC
- Message-ID
- <f455db00-2064-4c2f-be2e-6c5970843f03@gmail.com>
- In-Reply-To
- <Z7-lbGnlzGbhrHZN@tapette.crustytoothpaste.net>
On 26/02/2025 23:36, brian m. carlson wrote:
Show 13 quoted lines
> On 2025-02-26 at 07:38:22, Jeff King wrote: >> On Tue, Feb 25, 2025 at 11:44:33PM +0000, Yaakov Smith wrote: >>> >>> Should "git config" be smarter here and print something other than a >>> literal backspace to the terminal, like "git fetch" does? >> >> So I would say no here, in general. > > I agree this is the right choice in general. I wonder if we might want > some sort of human-readable output option that might escape these that > users could use. The output might still be machine-readable, but it > might be easier to parse than the current format, which has some tricky > edge cases when a config value contains newlines.
We have '-z' to avoid that ambiguity. I agree that having an option to provide a human-readable output would be a nice addition.
Best Wishes
Phillip
Show 5 quoted lines
> We already have precedent for this in core.quotePath and could easily > use similar logic here. That format, while using octal, which I find > ugly and hard to read, does have the pleasant side effect that it works > correctly with POSIX printf(1) (which I'm sure was intentional), unlike > hex escapes.