"Derrick Stolee via GitGitGadget" [off-list ref] writes:
+static struct command commands[] = {
+ /* unknown_command must be last. */
+ {
+ .name = "",
+ .fn = unknown_command,
+ },
+};
A useful trick is to deliberately omit the trailing comma after the
element that MUST be last. You did that for the __NR enum element
in a later step.
+#define COMMAND_COUNT ((size_t)(sizeof(commands) / sizeof(*commands)))
Isn't this ARRAY_SIZE(commands)?
+ while (!(res = process_command(repo)));
Please write an empty statement on its own line, i.e.
while (!(res = process_command(repo)))
;