Subject: Re: [PATCH 8/8] ci: use Meson's new `--slice` option

From: Junio C Hamano <[email-masked]>
Date: Mon, 07 Jul 2025 21:39:30 -0700

Jeff King <[email-masked]> writes:

> That does renumber the job titles. Probably not important, but they
> wouldn't match the non-meson ones anymore (though I am not sure if we
> even slice in the same way, so maybe it does not matter at all).
>
> Anyway, the more minimal fix is:
>
> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
> index 673b1c44b9..7739bd2d76 100644
> --- a/.github/workflows/main.yml
> +++ b/.github/workflows/main.yml
> @@ -306,7 +306,7 @@ jobs:
>          path: build
>      - name: Test
>        shell: pwsh
> -      run: meson test -C build --no-rebuild --print-errorlogs --slice ${{ matrix.nr }}/10
> +      run: meson test -C build --no-rebuild --print-errorlogs --slice "$(1+${{ matrix.nr }})/10"

It is confusing that $(...) is not a command substitution in shell
but somehow performs arithmetic X-<.

>    regular:
>      name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}})
>
> with the additional bonus that I can put "PowerShell Hacker" on my
> resume now.
>
> Curiously the quotes around the whole thing are required. If you do
> just:
>
>   $(1+1)/10
>
> you will get two arguments: "2" and "/10". Definitely surprising to me
> coming from a bourne shell background.

True.