Re: [PATCH 0/4] rev-list: introduce NUL-delimited output mode
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Mar 14, 2025, 19:53 UTC
- Message-ID
- <po5vjngxt6afwdkg7bvpw5j4dhot5h4uz5yudb3o4eug4k2nqu@rwp5rpe5d3u6>
- In-Reply-To
- <20250314185914.GD578421@coredump.intra.peff.net>
On 25/03/14 02:59PM, Jeff King wrote:
Show 22 quoted lines
> On Fri, Mar 14, 2025 at 10:02:11AM -0700, Junio C Hamano wrote:
> > Having said that, at the plumbing level, my preference is to have
> > two independent options "--nul-delimited-{output,input}". It does
> > not prevent us from starting with a single "-z" that works as a
> > short-hand that flips both on (and is inconsistent with "git log" at
> > the Porcelain level), but we can make "-z" only for output for
> > consistency. As long as we agree on the design to allow us to
> > control both sides independently, starting with "-z" that is only
> > for output may be the best way forward.
>
> Yeah, I almost suggested earlier having longer, unambiguous names. And
> then that punts the issue from "which functionality should be available"
> to "which functionality should be mapped to short-and-sweet -z".
>
> I do think it's still worth considering what "-z" should do _now_,
> though, because it will be painful/impossible to switch its behavior
> later. And people seemed to like the "both input and output" direction.
> That would leave the longer names as escape hatches. I.e., I'd expect:
>
> git rev-list -z --no-nul-delimited-input --stdin
>
> to use newlines for the input and NULs for the output.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.
If we want to do something along these lines, I can send another verison of this series where we drop "-z" in favor of using this option.
-Justin