Re: [GSoC RFC PATCH v4 2/4] repo: add the field references.format
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jul 16, 2025, 14:04 UTC
- Message-ID
- <2v7b6mpufnn6cj7u7tactgu2ibggn4xpuezl2bsfjxv62afrsa@chfrii6vkrx3>
- In-Reply-To
- <aHc6y9FGFXjowkU1@pks.im>
On 25/07/16 07:38AM, Patrick Steinhardt wrote:
Show 13 quoted lines
> On Tue, Jul 15, 2025 at 02:15:07PM -0500, Justin Tobler wrote: > > Also, as mentioned in a comment for the previous patch, maybe we should > > support printing two output modes. For the default output, maybe a > > simple `<key>=<value>\n` where the any value containing special > > characters is quoted via `quote_c_style()`. > > > > A null-terminated output, such as the one proposed in this patch, could > > be enabled via a `-z` flag similar to how its done in other commands. > > Agreed in general, but instead of using `-z` I wonder whether it would > make sense to use something like `--format=key-value` and `--format=nul` > instead. This gives us more room to introduce additional formats in the > future, like for example the JSON format that was scrapped for now.
If we already plan to support additional output formats, they I agree we should probably a `--format=<output-type>` flag from the start. I still think it would be nice to have a `-z` flag that is shorthand for `--format=nul` though as that is fairly common across other commands to have such an option.
Out of curiousity, is there a reason we are interested in supporting a JSON output format in addition to what is already proposed? From an earlier conversation I had with Lucas, it didn't seem like there was any particular reason for JSON.
-Justin