Re: [PATCH v8 2/3] maintenance: `git maintenance run` learned `--scheduler=<scheduler>`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/23/2021 4:40 PM, Lénaïc Huard wrote:> + * Ex.:
> + *   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.

> +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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux