Re: [PATCH 0/3] t: add "test-tool genbytes" to avoid slow tr(1) on macOS
- From
Kristofer Karlsson <krka@spotify.com>
- Date
- Nov 8, 2026, 09:13 UTC
- Message-ID
- <CAL71e4OGJWYPO5Wbcj16JwbhiXB0+EiAerH+ur19jWiM2hkyKg@mail.gmail.com>
- In-Reply-To
- <xmqqjymo8bv6.fsf@gitster.g>
On Sun, 8 Nov 2026 at 00:23, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> > "Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com> > writes: > > > Open question: is patch 3 wanted? It folds "genzeros" into "genbytes", > > spelling the NUL byte as "NUL", so that there is a single command. > > I would suggest genbytes to take the value of the byte in decimal or > hex, instead of av[1][0], so that you do not have to treat NUL any > specially. I would actually think it is even better to limit the > input format only to [0-9a-f][0-9a-f], i.e., two hexadecimal digits > that does not allow uppercase to represent values 0-255 (inclusive), > without support for any other input format like decimal. > > After all, this is just a test helper, so ergonomics or flexibility > do not matter as much as simplicity.
Yes, I actually had one local prototype that used this approach, but I held off on it since it would mean a semantically larger change. But I agree it would improve the ergonomics, so I can do it. And it's not too many call sites to convert anyway.
Thanks, Kristofer