Re: [PATCH v2 12/12] t0612: add tests to exercise Git/JGit reftable compatibility
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 8, 2024, 16:29 UTC
- Message-ID
- <CAPig+cRERJGij+1486x3w97y6k=KHTSzp+FepbyUi080R6m1aw@mail.gmail.com>
- In-Reply-To
- <CAPig+cQd7yfVVr+yZDxYY_oe8wC5OGt-SKtCnhCzZqJ0avP-Jg@mail.gmail.com>
On Mon, Apr 8, 2024 at 12:19 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 27 quoted lines
> On Mon, Apr 8, 2024 at 12:07 PM Junio C Hamano <gitster@pobox.com> wrote:
> > Eric Sunshine <sunshine@sunshineco.com> writes:
> > > I was going to suggest that you could accomplish this more easily
> > > directly in shell (without employing `awk`):
> > >
> > > {
> > > echo start &&
> > > printf "create refs/heads/branch-%d HEAD\n" $(test_seq 0 9999) &&
> > > echo commit
> > > } >input &&
> > >
> > > but then I realized that that could potentially run afoul of
> > > command-line length limit on some platform due to the 0-9999 sequence.
> >
> > As xargs is supposed to know the system limit, perhaps
> >
> > test_seq 0 9999 | xargs printf "...%d...\n"
> >
> > should work?
>
> Hmm, yes, that should work nicely.
>
> Whether or not such a change is worthwhile is a different matter.
> Although it is perhaps simpler and easier to read, Windows folk might
> not appreciate it since it spawns at least three processes (and
> perhaps more depending upon how test_seq is implemented), whereas the
> `awk` approach spawns a single process.And, to be clear, I have no objection to this patch's use of `awk`. It is "good enough" as is; I was not asking Patrick to make the change, but rather made the comment in case the idea hadn't occurred to him.