Thread (119 messages) 119 messages, 15 authors, 2021-09-27

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

From: Derrick Stolee <hidden>
Date: 2021-08-24 18:01:16

On 8/23/2021 4:40 PM, Lénaïc Huard wrote:> + * Ex.:
quoted hunk ↗ jump to hunk
+ *   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.
quoted hunk ↗ jump to hunk
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help