Subject: Re: [GSoC PATCH v5 1/5] repo: declare the repo command

From: Patrick Steinhardt <[email-masked]>
Date: Fri, 25 Jul 2025 07:10:05 +0200

On Thu, Jul 24, 2025 at 09:06:57AM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <[email-masked]> writes:
> > I'm not really too sure whether we need to bother with quoting. The
> > LF-separated output shouldn't ever be used in a script, so I don't mind
> > too much whether it always works. But I guess it wouldn't be hard either
> > to just have something like:
> >
> >     if (uses_newline)
> >         quote_c_style(...);
> >
> > So with that in mind it's probably better to just do the right thing.
> 
> The right thing being...?  Use <LF> as a record separator to avoid
> forcing <NUL> on possible human readers, and adopt quoting in a rare
> case where <LF>s or <NUL>s need to be in the payload?  Or something
> else?

Use <LF> by default to help humans, but do C-style quoting in that case.
Provide <NUL> terminated output format for machines so that they don't
have to care about unquoting.

Patrick