On Thu, Jul 24, 2025 at 09:06:57AM -0700, Junio C Hamano wrote: > Patrick Steinhardt <ps@xxxxxx> 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