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

Improvement: `git-maintenance` to allow configuring of remotes to fetch

From
Shubham Kanodia <shubhamsizzles@gmail.com>
Date
Aug 26, 2024, 11:50 UTC
Message-ID
<CAG=Um+1wTbXn_RN+LOCrpZpSNR_QF582PszxNyhz5anVHtBp+w@mail.gmail.com>

`git-maintenance` aims to improve the health & performance of especially large git repositories. A part of git maintenance tasks is `prefetch`.

However, at the moment, it prefetches all objects from all branches —
> The prefetch task updates the object directory with the latest objects from all registered remotes.

This seems non-optimal for repositories where users use the main repository to fork branches (instead of personal forks) as the remote could have thousands of refs and objects from branches that a user may not care about, leading to a very large prefetch dir.

For large repositories, it might instead be helpful to only fetch objects on `main` or `master` because those are the ones most likely to be used by users.

To this effect, git maintenance should perhaps expose a maintenance.prefetch.refs setting that subsets prefetching only to certain references.

Is this something that has been raised before / is in works by any chance or something that would be an acceptable contribution?

-- 
Regards,
Shubham Kanodia
Next: Patrick Steinhardt
Message 1 of 10 in “Improvement: `git-maintenance` to allow configuring of remotes to fetch”
  1. Shubham KanodiaAug 26, 2024
  2. Patrick SteinhardtAug 28, 2024
  3. Junio C HamanoAug 28, 2024
  4. Shubham KanodiaSep 2, 2024
  5. Patrick SteinhardtSep 3, 2024
  6. Shubham KanodiaSep 3, 2024
  7. Patrick SteinhardtSep 3, 2024
  8. Junio C HamanoSep 3, 2024
  9. Shubham KanodiaSep 4, 2024
  10. Shubham KanodiaSep 4, 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.