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

reflog expire: default expiry times swapped since 2.50

From
Rr.norouzi <r.norouzi@proton.me>
Date
Sep 19, 2026, 18:32 UTC
Message-ID
<GZicFFe4cqB928v52ERTcEFaAFtAwL0rp8VaCKSMyYzJ48XbQ9XoduiDtsou0Qp4N2CGmCS49uRbxi9dUWwlFzgzlt0PkGzR7IkqysP9tVQ=@proton.me>
What did you do before the bug happened? (Steps to reproduce your issue)

I made a reflog entry 60 days old on a branch that still contains the commit, then i asked what "git reflog expire" would prune, with no gc.reflogExpire or gc.reflogExpireUnreachable configured:

    git init -q -b main repro && cd repro
    t=$(date -d '60 days ago' +%s)
    GIT_COMMITTER_DATE="@$t +0000" GIT_AUTHOR_DATE="@$t +0000" \
            git commit -q --allow-empty -m old
    git commit -q --allow-empty -m new
    git reflog expire --dry-run --verbose main
What did you expect to happen? (Expected behavior)

The entry for "old" to be kept. The documentation of gc.reflogExpire says it defaults to 90 days, and gc.reflogExpireUnreachable to 30 days.

What happened instead? (Actual behavior)
    prune commit (initial): old
    keep commit: new
With -c gc.reflogExpire=90.days.ago the entry is kept.
What's different between what you expected and what actually happened?

Reachable entries expire after 30 days instead of 90. Since the total cut-off is checked first, every entry older than 30 days is now pruned, and the unreachable cut-off never matters.

Anything else you want to add:

The defaults look swapped in 85658275702b (builtin/reflog: stop storing default reflog expiry dates globaly), first released in 2.50.0. Before it, builtin/reflog.c had

    default_reflog_expire_unreachable = now - 30 * 24 * 3600;
    default_reflog_expire = now - 90 * 24 * 3600;
and reflog.h now has
    .default_expire_total = now - 30 * 24 * 3600, \
    .default_expire_unreachable = now - 90 * 24 * 3600, \

master still has the reflog.h version. Seen with 2.55.0 (Git for Windows 2.55.0.windows.5); the code in question is not platform specific.

Next: Pushkar Singh
Message 1 of 19 in “reflog expire: default expiry times swapped since 2.50”
  1. r.norouziSep 19, 2026
  2. reflog: fix default expiry periodsPushkar Singh, Sep 22, 2026
  3. Junio C HamanoSep 22, 2026
  4. Jeff KingSep 22, 2026
  5. Patrick SteinhardtSep 23, 2026
  6. reflog: fix default expiry periodsPushkar Singh, Sep 23, 2026
  7. Junio C HamanoSep 23, 2026
  8. Patrick SteinhardtSep 24, 2026
  9. Jeff KingSep 24, 2026
  10. Junio C HamanoSep 24, 2026
  11. Jeff KingSep 24, 2026
  12. Patrick SteinhardtSep 28, 2026
  13. Junio C HamanoSep 24, 2026
  14. reflog: fix default expiry periodsPushkar Singh, Sep 24, 2026
  15. Junio C HamanoSep 24, 2026
  16. Patrick SteinhardtSep 28, 2026
  17. Junio C HamanoSep 28, 2026
  18. Patrick SteinhardtSep 29, 2026
  19. Junio C HamanoSep 29, 2026

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.