Re: [GSoC PATCH v5 1/5] repo: declare the repo command
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 25, 2025, 05:10 UTC
- Message-ID
- <aIMRrV3Atv35xeXj@pks.im>
- In-Reply-To
- <xmqqwm7xindq.fsf@gitster.g>
On Thu, Jul 24, 2025 at 09:06:57AM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> Patrick Steinhardt <ps@pks.im> 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