Skip to content

Commit eba1ba9

Browse files
L3n41cgitster
authored andcommitted
maintenance: git maintenance run learned --scheduler=<scheduler>
Depending on the system, different schedulers can be used to schedule the hourly, daily and weekly executions of `git maintenance run`: * `launchctl` for MacOS, * `schtasks` for Windows and * `crontab` for everything else. `git maintenance run` now has an option to let the end-user explicitly choose which scheduler he wants to use: `--scheduler=auto|crontab|launchctl|schtasks`. When `git maintenance start --scheduler=XXX` is run, it not only registers `git maintenance run` tasks in the scheduler XXX, it also removes the `git maintenance run` tasks from all the other schedulers to ensure we cannot have two schedulers launching concurrent identical tasks. The default value is `auto` which chooses a suitable scheduler for the system. `git maintenance stop` doesn't have any `--scheduler` parameter because this command will try to remove the `git maintenance run` tasks from all the available schedulers. Signed-off-by: Lénaïc Huard <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb7db5b commit eba1ba9

File tree

3 files changed

+354
-75
lines changed

3 files changed

+354
-75
lines changed

Documentation/git-maintenance.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,15 @@ OPTIONS
179179
`maintenance.<task>.enabled` configured as `true` are considered.
180180
See the 'TASKS' section for the list of accepted `<task>` values.
181181

182+
--scheduler=auto|crontab|launchctl|schtasks::
183+
When combined with the `start` subcommand, specify the scheduler
184+
for running the hourly, daily and weekly executions of
185+
`git maintenance run`.
186+
Possible values for `<scheduler>` are `auto`, `crontab` (POSIX),
187+
`launchctl` (macOS), and `schtasks` (Windows).
188+
When `auto` is specified, the appropriate platform-specific
189+
scheduler is used. Default is `auto`.
190+
182191

183192
TROUBLESHOOTING
184193
---------------

0 commit comments

Comments
 (0)