Subject: Re: [PATCH 0/4] rev-list: introduce NUL-delimited output mode

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 Mar 2025 14:16:58 -0700

Justin Tobler <[email-masked]> writes:

> If we want to adopt less ambiguous long options names for NUL-delimited
> input/output options as an alternative to "-z", maybe we could do
> something like:
>
>     $ git rev-list --nul-delimited={all,input,output}
>
> where the default for the `--nul-delimited` could be both input/output. 

I'd prefer not to see that route taken, as it does not look any
"less ambiguous" at least to me.  Making individual selections are
almost the same in either syntax, and the only difference is that
--nul-delimited-input --nul-delimited-output can be independently
chosen and given and happen to end up selecting both.

But with --nul-delimited=<value>, you have to plan ahead and choose
"all".  When your script first wants NUL delimited I/O on the output
side, you'd write "output".  When later you want to allow it to
optionally take NUL delimited I/O on the input side, you have to
notice that you have "output" there already and replace it with "all".
If the initial version did not have NUL-delimited output, your change
to add support for NUL-delimited input would be different.

And you also have to remember that it has to be spelled "all" and
not "both" when you replace existing "output".

In other words, I'd prefer to leave independent/orthogonal things as
such, even if such a general design principle may make the result a
bit more verbose, at the plumbing level.

Thanks.