On Mon, Apr 8, 2024 at 12:07 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > Eric Sunshine <sunshine@xxxxxxxxxxxxxx> 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.