Subject: Re: [PATCH] worktree: add -z option for list subcommand

From: Junio C Hamano <[email-masked]>
Date: Mon, 28 Feb 2022 09:16:37 -0800

Eric Sunshine <[email-masked]> writes:

>> Unless the original wasn't using quote_c_style() correctly and
>> wasn't quoting its output, that is?
>
> That's the case. It is impossible without this patch since `git
> worktree list --porcelain` does not call quote_c_style() for the
> worktree path; it only calls quote_c_style() for the lock reason.

Yuck.  That's an outright bug that we should fix.  I do not think it
makes "-z" unnecessary, but those who want to read from non-z output
cannot sensibly do so with funny letters in their paths with today's
output, and as long as quote_c_style() tweaks the output only when
funny letters need to be quoted, those who are reading from today's
non-z output will not be hurt, so let's fix that first or at the
same time as we add "-z".

Thanks.