From eb2d7beb0e5e3823a9271a65eeeaed74a0144e2a Mon Sep 17 00:00:00 2001 From: Josh Heinrichs Date: Sun, 20 Apr 2025 23:46:33 -0600 Subject: [PATCH] maintenance: fix launchctl calendar intervals When using the launchctl scheduler, the weekly job runs daily, and the daily job runs on the first six days of each month. This appears to be due to specifying "Day" in the calendar intervals, which according to launchd.plist(5) is for specifying days of the month rather than days of the week. The behaviour of running a job on the 0th day is undocumented, but in my testing appears to be the same as not specifying "Day" in the calendar interval, in which case the job will run daily. Use "Weekday" in the calendar intervals, which is the correct way to schedule jobs to run on specific days of the week. Signed-off-by: Josh Heinrichs Acked-by: Derrick Stolee Signed-off-by: Junio C Hamano --- builtin/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index a9b1c36de2..af1665a943 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -2061,7 +2061,7 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit case SCHEDULE_DAILY: repeat = "\n" - "Day%d\n" + "Weekday%d\n" "Hour0\n" "Minute%d\n" "\n"; @@ -2072,7 +2072,7 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit case SCHEDULE_WEEKLY: strbuf_addf(&plist, "\n" - "Day0\n" + "Weekday0\n" "Hour0\n" "Minute%d\n" "\n",