On Wed, Jul 16, 2025 at 09:04:40AM -0500, Justin Tobler wrote: > On 25/07/16 07:38AM, Patrick Steinhardt wrote: > > 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. I don't care much about the JSON output format. What I do care about is to have a default format that we are free to iterate on, especially in the context of `git repo size`. If we ever want to have output that is as user friendly as git-sizer(1)'s we need to have that freedom.