git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git maintenance" - detect status?

From
Derrick Stolee <derrickstolee@github.com>
Date
Feb 14, 2023, 17:07 UTC
Message-ID
<2eb324c9-4908-5ace-4724-72c2815674fb@github.com>
In-Reply-To
<CAPMMpohJ1gajTYOA9ZJjq=hASA9ry9fKP02TYH2dDF+VBeek8w@mail.gmail.com>
On 2/14/2023 5:50 AM, Tao Klerks wrote:
Show 12 quoted lines
> However, I can't figure out how to test the current state of
> scheduling, from within git:
>  * There's no config value representing "scheduling is enabled" (as
> far as I can tell)
>  * There's no "git maintenance" subcommand for "check on the
> scheduling tasks" (as far as I can tell)
> 
> In principle I guess it's possible to check for the Task Scheduler
> entries and their status in Windows, for example, but that sounds...
> like relying on implementation details.
> 
> Is there any correct cross-platform way to detect the scheduling state?

Not currently, but you do make a good point about the scheduler being an implementation detail.

You're making a good case for a new subcommand like 'git maintenance status' that would report these details. It could even be a three- tiered result:

  $ git maintenance status
  global scheduler: on
  repository schedule: enabled
  foreground maintenance: disabled

...or something like that. Not sure how to properly describe the maintenance.auto config option as anything other than "foreground maintenance", even if it launches maintenance processes in the background on most platforms.

Of course, it could be worth exploring more about the specific schedule the repository is scheduled for. It could describe the maintenance.strategy value that is assumed (if there is one) or even break down the tasks that will be run on different cadences:

  $ git maintenance status
  global scheduler: on
  repository schedule: enabled
    strategy: incremental
    hourly: prefetch, commit-graph
    daily: incremental-repack
    weekly: pack-refs
  foreground maintenance: disabled

Finally, making this something machine-readable (say, key=value lines or JSON output) could be valuable behind an argument.

These are all just "top of mind" thoughts when I read your questions, so feel free to disregard any or all of it. Just ideas to think about.

Thanks, -Stolee

Previous: Tao Klerks
Message 2 of 2 in “"git maintenance" - detect status?”
  1. Tao KlerksFeb 14, 2023
  2. Derrick StoleeFeb 14, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.