Re: [PATCH v8 2/3] maintenance: `git maintenance run` learned `--scheduler=<scheduler>`
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Aug 24, 2021, 17:45 UTC
- Message-ID
- <bd93fdca-3b37-2d71-2e6c-6e0e38ad098f@gmail.com>
- In-Reply-To
- <20210823204011.87023-3-lenaic@lhuard.fr>
On 8/23/2021 4:40 PM, Lénaïc Huard wrote:> + * Ex.:
Show 17 quoted lines
> + * GIT_TEST_MAINT_SCHEDULER not set > + * +-------+-------------------------------------------------+ > + * | Input | Output | > + * | *cmd | return code | *cmd | *is_available | > + * +-------+-------------+-------------------+---------------+ > + * | "foo" | false | "foo" (unchanged) | (unchanged) | > + * +-------+-------------+-------------------+---------------+ > + * > + * GIT_TEST_MAINT_SCHEDULER set to “foo:./mock_foo.sh,bar:./mock_bar.sh” > + * +-------+-------------------------------------------------+ > + * | Input | Output | > + * | *cmd | return code | *cmd | *is_available | > + * +-------+-------------+-------------------+---------------+ > + * | "foo" | true | "./mock.foo.sh" | true | > + * | "qux" | true | "qux" (unchanged) | false | > + * +-------+-------------+-------------------+---------------+ > + */
Thank you for updating to this ASCII table. It has the same amount of visual information without requiring special characters.
Show 13 quoted lines
> +static int is_launchctl_available(void)
> +{
> + const char *cmd = "launchctl";
> + int is_available;
> + if (get_schedule_cmd(&cmd, &is_available))
> + return is_available;
> +
> +#ifdef __APPLE__
> + return 1;
> +#else
> + return 0;
> +#endif
> +}I find this use of #ifdef to be perfectly fine. Adding a layer of indirection into the compat layer through another macro is unnecessary, in my opinion.
Thanks, -Stolee