mbox series

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

Message ID 20250408-pks-maintenance-reflog-expire-v2-0-1ad8634798b7@pks.im (mailing list archive)
Headers show
Series builtin/maintenance: introduce "reflog-expire" task | expand

Message

Patrick Steinhardt April 8, 2025, 6:22 a.m. UTC
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