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

[PATCH 0/2] Maintenance: add pack-refs task

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 8, 2021, 14:52 UTC
Message-ID
<pull.871.git.1612795943.gitgitgadget@gmail.com>

This patch series adds a new pack-refs task to the maintenance builtin. This operation already happens within git gc (and hence the gc task) but it is easy to extract. Packing refs does not delete any data, only collects loose objects into a combined file. This makes things faster in subtle ways, especially when a command needs to iterate through refs (especially tags).

Credit for inspiring this goes to Suolong, who asked for this to be added to Scalar [1]. I've been waiting instead to add it directly to Git and its background maintenance. Now is the time!

[1] https://github.com/microsoft/scalar/issues/382

I chose to add it to the incremental maintenance strategy at a weekly cadence. I'm not sure there is significant value to the difference between weekly and daily. It just seems to me that weekly is often enough. Feel free to correct me if you have a different opinion.

My hope is that this patch series could be used as an example for further extracting tasks out of the gc task and making them be full maintenance tasks. Doing more of these extractions could be a good project for a new contributor.

One thing that is not implemented in this series is a notion of the behavior for the pack-refs task during git maintenance run --auto. This could be added in the future, but I wanted to focus on getting this behavior into the incremental maintenance schedule.

Thanks, -Stolee
Derrick Stolee (2):
  maintenance: add pack-refs task
  maintenance: incremental strategy runs pack-refs weekly
 Documentation/config/maintenance.txt |  5 +++--
 Documentation/git-maintenance.txt    |  6 ++++++
 builtin/gc.c                         | 23 +++++++++++++++++++----
 t/t7900-maintenance.sh               | 24 ++++++++++++++++++++++++
 4 files changed, 52 insertions(+), 6 deletions(-)
base-commit: fb7fa4a1fd273f22efcafdd13c7f897814fd1eb9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-871%2Fderrickstolee%2Fmaintenance%2Fpack-refs-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-871/derrickstolee/maintenance/pack-refs-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/871
-- 
gitgitgadget
Next: Derrick Stolee via GitGitGadget
Message 1 of 12 in “Maintenance: add pack-refs task”
  1. 0/2 Maintenance: add pack-refs taskDerrick Stolee via GitGitGadget, Feb 8, 2021
  2. 2/2 maintenance: incremental strategy runs pack-refs weeklyDerrick Stolee via GitGitGadget, Feb 8, 2021
  3. 1/2 maintenance: add pack-refs taskDerrick Stolee via GitGitGadget, Feb 8, 2021
  4. Taylor BlauFeb 8, 2021
  5. Derrick StoleeFeb 9, 2021
  6. Eric SunshineFeb 8, 2021
  7. Derrick StoleeFeb 9, 2021
  8. Taylor BlauFeb 8, 2021
  9. 0/2 Maintenance: add pack-refs taskDerrick Stolee via GitGitGadget, Feb 9, 2021
  10. 1/2 maintenance: add pack-refs taskDerrick Stolee via GitGitGadget, Feb 9, 2021
  11. 2/2 maintenance: incremental strategy runs pack-refs weeklyDerrick Stolee via GitGitGadget, Feb 9, 2021
  12. Taylor BlauFeb 10, 2021

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.