Skip to content

pr-776/derrickstolee/maintenance/macOS-v7

This is based on ds/maintenance-part-3.

After sitting with the background maintenance as it has been cooking, I
wanted to come back around and implement the background maintenance for
Windows. However, I noticed that there were some things bothering me with
background maintenance on my macOS machine. These are detailed in PATCH 3,
but the tl;dr is that 'cron' is not recommended by Apple and instead
'launchd' satisfies our needs.

This series implements the background scheduling so git maintenance
(start|stop) works on those platforms. I've been operating with these
schedules for a while now without the problems described in the patches.

There is a particularly annoying case about console windows popping up on
Windows, but PATCH 4 describes a plan to get around that.

Update in V7
============

 * I had included an "encoding" string in the XML file for schtasks based on
   an example using UTF-8. The cross-platform tests then complained (in
   xmllint) because they wrote in ASCII instead. However, actually testing
   the situation on Windows (see [1]) against the real schtasks finds that
   it doesn't like that encoding string. I removed it entirely, and
   everything seems happier.

 * I squashed Eric's two commits making the tests better. He remains a
   co-author and I kept his Helped-by. I had to rearrange the commit message
   a bit to point out the care he took for the cross-platform tests without
   referring to the test doing the wrong thing.

[1] https://github.com/microsoft/git/pull/304

Thanks, -Stolee

cc: jrnieder@gmail.com cc: jonathantanmy@google.com cc: sluongng@gmail.com
cc: Đoàn Trần Công Danh congdanhqx@gmail.com cc: Martin Ågren
martin.agren@gmail.com cc: Eric Sunshine sunshine@sunshineco.com cc: Derrick
Stolee stolee@gmail.com

Derrick Stolee (4):
  maintenance: extract platform-specific scheduling
  maintenance: include 'cron' details in docs
  maintenance: use launchctl on macOS
  maintenance: use Windows scheduled tasks

 Documentation/git-maintenance.txt | 116 ++++++++
 builtin/gc.c                      | 422 ++++++++++++++++++++++++++++--
 t/t7900-maintenance.sh            | 104 +++++++-
 t/test-lib.sh                     |   7 +-
 4 files changed, 615 insertions(+), 34 deletions(-)

base-commit: 0016b618182f642771dc589cf0090289f9fe1b4f

Submitted-As: https://lore.kernel.org/git/pull.776.v7.git.1609852108.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.776.git.1604412196.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.776.v2.git.1604520368.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.776.v3.git.1605276024.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.776.v4.git.1605647598.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.776.v5.git.1606191405.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.776.v6.git.1607542142.gitgitgadget@gmail.com
Assets 2