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

Re: [PATCH 0/2] builtin/receive-pack: convert to use git-maintenance(1)

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 18, 2024, 05:43 UTC
Message-ID
<ZiCzAodY-L0QvX8s@tanuki>
In-Reply-To
<xmqqwmow7wwp.fsf@gitster.g>
On Wed, Apr 17, 2024 at 09:53:58AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
> 
> >> this small patch series adapts git-receive-pack(1) to spawn `git
> >> maintenance run --auto` instead of `git gc --auto` like all the other
> >> parts of our codebase do nowadays. This removes the last internal user
> >> of `git gc --auto`.
> >
> > I don't have enough context here, so why do this?

Fair enough, I was a bit lazy with the cover letter as I thought that the second patch already explains it well enough. But true, I should've set the stage a bit better.

Show 6 quoted lines
> I think the intent of a95ce124 (maintenance: replace run_auto_gc(),
> 2020-09-17) was to update all codepaths that run "git gc --auto" to
> instead run "git maintenance --auto", but only updated the ones that
> used to call run_auto_gc().  The codepath Patrick found runs "git gc
> --auto" without using run_auto_gc() and was left behind when the
> others were converted.

Yup, that was triggered this patch series. I was puzzled that we still run `git gc --auto` at all.

Show 7 quoted lines
> So why do this?  I think "To follow through a95ce124 started" would
> probably be a good enough reason, if a reader is on board with what
> a95ce124 wanted to do.
> 
> Do we have a handy reference that compares "gc --auto" and
> "maintenance --auto"?  Are they essentially the same thing these
> days?  What are the things that is done by one but not by the other?

git-maintenance(1) is a superset of what git-gc(1) does. It is structured around different "tasks" that the user can enable or disable at a whim. By default, only a single "gc" task is enabled, which makes it a drop-in replacement for what we had before the conversion.

But users can ask git-maintenance(1) to perform housekeeping to their will. Instead of running git-gc(1), they can configure indididual tasks to repack objects via multi-pack indices, pack only loose objects, update the commit-graph or repack references.

So overall, git-maintenance(1) is the modern and more flexible replacement for git-gc(1) that gives more tuning knobs.

Patrick
Previous: Junio C Hamano
Message 9 of 9 in “builtin/receive-pack: convert to use git-maintenance(1)”
  1. 0/2 builtin/receive-pack: convert to use git-maintenance(1)Patrick Steinhardt, Apr 17, 2024
  2. 1/2 run-command: introduce function to prepare auto-maintenance processPatrick Steinhardt, Apr 17, 2024
  3. Junio C HamanoApr 17, 2024
  4. Patrick SteinhardtApr 18, 2024
  5. 2/2 builtin/receive-pack: convert to use git-maintenance(1)Patrick Steinhardt, Apr 17, 2024
  6. Karthik NayakApr 17, 2024
  7. Karthik NayakApr 17, 2024
  8. Junio C HamanoApr 17, 2024
  9. Patrick SteinhardtApr 18, 2024

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.