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

[PATCH v2 0/6] builtin/maintenance: introduce "reflog-expire" task

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 8, 2025, 06:22 UTC
Message-ID
<20250408-pks-maintenance-reflog-expire-v2-0-1ad8634798b7@pks.im>
In-Reply-To
<20250226-pks-maintenance-reflog-expire-v1-0-a1204a814952@pks.im>
Hi,

this patch series introduces a new "reflog-expire" task to git-maintenance(1). This task is designed to plug a gap when the "gc" task is disabled, as there is no way to expire reflog entries in that case.

This patch series has been inspired by the discussion at [1]. I consider it to be another step into the direction of replacing git-gc(1) and allowing for more flexible maintenance strategies overall. Next steps could be:

  1. Enable the "reflog-expire" task by default when using the
     "incremental" strategy. and then we might eventually switch over
     the
  2. Use "incremental" strategy when "features.experimental" is enabled.
  3. Switch over the default strategy to "incremental" after a couple of
     releases.
Changes in v2:
  - Two commit message typos.
  - Link to v1: https://lore.kernel.org/r/20250226-pks-maintenance-reflog-expire-v1-0-a1204a814952@pks.im
Thanks!
Patrick
[1]: <e650f4e4-e267-4f1f-bb3a-c71b1fe0b276@uxp.de>
---
Patrick Steinhardt (6):
      reflog: rename `cmd_reflog_expire_cb` to `reflog_expire_options`
      builtin/reflog: stop storing default reflog expiry dates globally
      builtin/reflog: stop storing per-reflog expiry dates globally
      builtin/reflog: make functions regarding `reflog_expire_options` public
      builtin/gc: split out function to expire reflog entries
      builtin/maintenance: introduce "reflog-expire" task
 Documentation/config/maintenance.adoc |   9 ++
 Documentation/git-maintenance.adoc    |   4 +
 builtin/gc.c                          |  72 +++++++++++++---
 builtin/reflog.c                      | 153 ++++------------------------------
 reflog.c                              | 137 ++++++++++++++++++++++++++----
 reflog.h                              |  35 +++++++-
 t/t7900-maintenance.sh                |  18 ++++
 7 files changed, 263 insertions(+), 165 deletions(-)
Range-diff versus v1:
1:  62ed4d1dcb6 = 1:  92d20e9403b reflog: rename `cmd_reflog_expire_cb` to `reflog_expire_options`
2:  c9da014e85c ! 2:  5625b7472f8 builtin/reflog: stop storing default reflog expiry dates globally
    @@ Commit message
     
           - The currently active set of expiry dates for a given reference.
     
    -    While the last item is stored in `struct reflog_expiry_options`, the
    +    While the last item is stored in `struct reflog_expire_options`, the
         other items aren't, which makes it hard to reuse the structure in other
         places.
     
3:  bd06fee3d23 ! 3:  146080fe970 builtin/reflog: stop storing per-reflog expiry dates globally
    @@ Commit message
     
         As described in the preceding commit, the per-reflog expiry dates are
         stored in a global pair of variables. Refactor the code so that they are
    -    contained in `sturct reflog_expire_options` to make the structure useful
    +    contained in `struct reflog_expire_options` to make the structure useful
         in other contexts.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
4:  90ec3a8ffc8 = 4:  0f40bf3f45a builtin/reflog: make functions regarding `reflog_expire_options` public
5:  17d0e940266 = 5:  3072a421957 builtin/gc: split out function to expire reflog entries
6:  5799eb30843 = 6:  ca81a7e5686 builtin/maintenance: introduce "reflog-expire" task

--- base-commit: 5a526e5e18ddb9a7dfc5a2967d21d6154df64a4f change-id: 20250226-pks-maintenance-reflog-expire-61c61410751a

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 20 of 26 in “builtin/maintenance: introduce "reflog-expire" task”
  1. 0/6 builtin/maintenance: introduce "reflog-expire" taskPatrick Steinhardt, Feb 26, 2025
  2. 1/6 reflog: rename `cmd_reflog_expire_cb` to `reflog_expire_options`Patrick Steinhardt, Feb 26, 2025
  3. 2/6 builtin/reflog: stop storing default reflog expiry dates globallyPatrick Steinhardt, Feb 26, 2025
  4. Justin ToblerMar 4, 2025
  5. 3/6 builtin/reflog: stop storing per-reflog expiry dates globallyPatrick Steinhardt, Feb 26, 2025
  6. Justin ToblerMar 4, 2025
  7. Patrick SteinhardtMar 6, 2025
  8. Justin ToblerMar 6, 2025
  9. 4/6 builtin/reflog: make functions regarding `reflog_expire_options` publicPatrick Steinhardt, Feb 26, 2025
  10. 5/6 builtin/gc: split out function to expire reflog entriesPatrick Steinhardt, Feb 26, 2025
  11. 6/6 builtin/maintenance: introduce "reflog-expire" taskPatrick Steinhardt, Feb 26, 2025
  12. Ramsay JonesFeb 26, 2025
  13. Junio C HamanoFeb 26, 2025
  14. Ramsay JonesFeb 26, 2025
  15. Patrick SteinhardtFeb 27, 2025
  16. Junio C HamanoFeb 27, 2025
  17. Patrick SteinhardtFeb 27, 2025
  18. Junio C HamanoFeb 27, 2025
  19. Patrick SteinhardtFeb 28, 2025
  20. 0/6 builtin/maintenance: introduce "reflog-expire" taskPatrick Steinhardt, Apr 8, 2025
  21. 2/6 builtin/reflog: stop storing default reflog expiry dates globallyPatrick Steinhardt, Apr 8, 2025
  22. 1/6 reflog: rename `cmd_reflog_expire_cb` to `reflog_expire_options`Patrick Steinhardt, Apr 8, 2025
  23. 3/6 builtin/reflog: stop storing per-reflog expiry dates globallyPatrick Steinhardt, Apr 8, 2025
  24. 4/6 builtin/reflog: make functions regarding `reflog_expire_options` publicPatrick Steinhardt, Apr 8, 2025
  25. 5/6 builtin/gc: split out function to expire reflog entriesPatrick Steinhardt, Apr 8, 2025
  26. 6/6 builtin/maintenance: introduce "reflog-expire" taskPatrick Steinhardt, Apr 8, 2025

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.