New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[For 2.34.0 Release] maintenance: disable cron on macOS #1075
Conversation
1104f1f
to
abf1ed5
Compare
In eba1ba9 (maintenance: `git maintenance run` learned `--scheduler=<scheduler>`, 2021-09-04), we introduced the ability to specify a scheduler explicitly. This led to some extra checks around whether an alternative scheduler was available. This added the functionality of removing background maintenance from schedulers other than the one selected. On macOS, cron is technically available, but running 'crontab' triggers a UI prompt asking for special permissions. This is the major reason why launchctl is used as the default scheduler. The is_crontab_available() method triggers this UI prompt, causing user disruption. Remove this disruption by using an #ifdef to prevent running crontab this way on macOS. This has the unfortunate downside that if a user manually selects cron via the '--scheduler' option, then adjusting the scheduler later will not remove the schedule from cron. The '--scheduler' option ignores the is_available checks, which is how we can get into this situation. Extract the new check_crontab_process() method to avoid making the 'child' variable unused on macOS. The method is marked MAYBE_UNUSED because it has no callers on macOS. Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
abf1ed5
to
e322dbc
Compare
/submit |
Submitted as pull.1075.git.1636569360002.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
User |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Derrick Stolee wrote (reply to this):
|
User |
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
|
User |
On the Git mailing list, Derrick Stolee wrote (reply to this):
|
This branch is now known as |
This patch series was integrated into seen via git@dc7d06d. |
This patch series was integrated into next via git@18eb9c1. |
This patch series was integrated into seen via git@c1d16ce. |
This patch series was integrated into next via git@c1d16ce. |
This patch series was integrated into master via git@c1d16ce. |
Closed via c1d16ce. |
This one is really tricky because we can't notice anything is wrong without running
git maintenance start
orgit maintenance stop
interactively on macOS. The tests pass just fine because the UI alert gets automatically ignored during the test suite.This is a bit of a half-fix: it avoids the UI alert, but has a corner case of not un-doing the
cron
schedule if a user manages to select it (under suitable permissions such that it succeeds). For the purpose of the timing of the release, I think this is an appropriate hedge.Thanks! -Stolee
cc: gitster@pobox.com
cc: lenaic@lhuard.fr
cc: Johannes Schindelin Johannes.Schindelin@gmx.de
cc: Derrick Stolee stolee@gmail.com
cc: Ævar Arnfjörð Bjarmason avarab@gmail.com