Message ID | pull.680.git.1597857408.gitgitgadget@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Maintenance III: background maintenance | expand |
On 2020-08-19 17:16:43+0000, Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote: > From: Derrick Stolee <dstolee@microsoft.com> > > Users may want to run certain maintenance tasks only so often. Update > the local config with a new 'maintenance.<task>.lastRun' config option > that stores the timestamp just before running the maintenance task. > > I selected the timestamp before the task, as opposed to after the task, > for a couple reasons: > > 1. The time the task takes to execute should not contribute to the > interval between running the tasks. If a daily task takes 10 minutes > to run, then every day the execution will drift by at least 10 > minutes. > > 2. If the task fails for some unforseen reason, it would be good to > indicate that we _attempted_ the task at a certain timestamp. This > will avoid spamming a repository that is in a bad state. > > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > Documentation/config/maintenance.txt | 5 +++++ > builtin/gc.c | 16 ++++++++++++++++ > git-gvfs-helper | Bin 0 -> 11171736 bytes > t/helper/test-gvfs-protocol | Bin 0 -> 10946928 bytes Look like those 2 files should be added into .gitignore, no?
On Wed, Aug 19, 2020 at 05:16:41PM +0000, Derrick Stolee via GitGitGadget wrote: > This is based on ds/maintenance-part-2, but with some local updates to > review feedback. It won't apply cleanly right now. This RFC is for early > feedback and not intended to make a new tracking branch until v2. > > This RFC is intended to show how I hope to integrate true background > maintenance into Git. As opposed to my original RFC [1], this entirely > integrates with cron (through crontab [-e|-l]) to launch maintenance > commands in the background. > > [1] > https://lore.kernel.org/git/pull.597.git.1585946894.gitgitgadget@gmail.com/ > > Some preliminary work is done to allow a new --scheduled option that > triggers enabled tasks only if they have not been run in some amount of > time. The timestamp of the previous run is stored in the > maintenance.<task>.lastRun config value while the interval is stored in the > maintenance.<task>.schedule config value. This changes the config file from read-mostly to continuously updated. Is that desirable? In particular it significanly increases the risk of race with the user editing the file. I think timestamps are not configuration and should be written to some other file. Or is there already a core git feature that continuously updates the config file? Thanks Michal