{"thread":{"id":"66354","subject":"reflog expire: default expiry times swapped since 2.50","startedAt":"2026-09-19T18:33:06Z","lastAt":"2026-09-29T18:31:08Z","messageCount":19,"participants":["r.norouzi","Pushkar Singh","Junio C Hamano","Jeff King","Patrick Steinhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"552892","messageId":"GZicFFe4cqB928v52ERTcEFaAFtAwL0rp8VaCKSMyYzJ48XbQ9XoduiDtsou0Qp4N2CGmCS49uRbxi9dUWwlFzgzlt0PkGzR7IkqysP9tVQ=@proton.me","threadId":"66354","inReplyTo":null,"subject":"reflog expire: default expiry times swapped since 2.50","fromName":"r.norouzi","fromEmail":"r.norouzi@proton.me","sentAt":"2026-09-19T18:32:55Z","receivedAt":"2026-09-19T18:33:06Z","isPatch":false,"body":"What did you do before the bug happened? (Steps to reproduce your issue)\n\nI made a reflog entry 60 days old on a branch that still contains the\ncommit, then i asked what \"git reflog expire\" would prune, with no\ngc.reflogExpire or gc.reflogExpireUnreachable configured:\n\n    git init -q -b main repro && cd repro\n    t=$(date -d '60 days ago' +%s)\n    GIT_COMMITTER_DATE=\"@$t +0000\" GIT_AUTHOR_DATE=\"@$t +0000\" \\\n            git commit -q --allow-empty -m old\n    git commit -q --allow-empty -m new\n    git reflog expire --dry-run --verbose main\n\nWhat did you expect to happen? (Expected behavior)\n\nThe entry for \"old\" to be kept. The documentation of gc.reflogExpire says\nit defaults to 90 days, and gc.reflogExpireUnreachable to 30 days.\n\nWhat happened instead? (Actual behavior)\n\n    prune commit (initial): old\n    keep commit: new\n\nWith -c gc.reflogExpire=90.days.ago the entry is kept.\n\nWhat's different between what you expected and what actually happened?\n\nReachable entries expire after 30 days instead of 90. Since the total\ncut-off is checked first, every entry older than 30 days is now pruned,\nand the unreachable cut-off never matters.\n\nAnything else you want to add:\n\nThe defaults look swapped in 85658275702b (builtin/reflog: stop storing\ndefault reflog expiry dates globaly), first released in 2.50.0. Before\nit, builtin/reflog.c had\n\n    default_reflog_expire_unreachable = now - 30 * 24 * 3600;\n    default_reflog_expire = now - 90 * 24 * 3600;\n\nand reflog.h now has\n\n    .default_expire_total = now - 30 * 24 * 3600, \\\n    .default_expire_unreachable = now - 90 * 24 * 3600, \\\n\nmaster still has the reflog.h version. Seen with 2.55.0 (Git for\nWindows 2.55.0.windows.5); the code in question is not platform\nspecific.\n\n"},{"id":"553001","messageId":"20260922165433.591551-2-pushkarkumarsingh1970@gmail.com","threadId":"66354","inReplyTo":"GZicFFe4cqB928v52ERTcEFaAFtAwL0rp8VaCKSMyYzJ48XbQ9XoduiDtsou0Qp4N2CGmCS49uRbxi9dUWwlFzgzlt0PkGzR7IkqysP9tVQ=@proton.me","subject":"[PATCH] reflog: fix default expiry periods","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-09-22T16:54:34Z","receivedAt":"2026-09-22T16:55:26Z","isPatch":true,"body":"The default expiry periods for reflog entries are reversed in\nREFLOG_EXPIRE_OPTIONS_INIT(). This causes reachable entries to\nexpire after 30 days instead of the documented 90 days.\n\nRestore the intended 90-day expiry for reachable entries and\n30-day expiry for unreachable entries.\n\nAdd a regression test for a reachable reflog entry that is\n60 days old.\n\nReported-by: r.norouzi <r.norouzi@proton.me>\nSigned-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n---\n reflog.h          |  4 ++--\n t/t1410-reflog.sh | 13 +++++++++++++\n 2 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/reflog.h b/reflog.h\nindex b996712c00..3bdd1ca8a5 100644\n--- a/reflog.h\n+++ b/reflog.h\n@@ -23,8 +23,8 @@ struct reflog_expire_options {\n \tint recno;\n };\n #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n-\t.default_expire_total = now - 30 * 24 * 3600, \\\n-\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n+\t.default_expire_total = now - 90 * 24 * 3600, \\\n+\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n }\n \n /*\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 8f78cf4b01..1239c078ef 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -153,6 +153,19 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n '\n \n+test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n+\ttest_when_finished \"rm -rf repo\" &&\n+\tgit init repo &&\n+\t(\n+\t\tcd repo &&\n+\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\tgit reflog expire --all &&\n+\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n+\t)\n+'\n+\n test_expect_success 'corrupt and check' '\n \n \tcorrupt $F &&\n-- \n2.56.0.rc1.320.g68acceee5b.dirty\n\n"},{"id":"553004","messageId":"xmqq5wzxfb79.fsf@gitster.g","threadId":"66354","inReplyTo":"20260922165433.591551-2-pushkarkumarsingh1970@gmail.com","subject":"Re: [PATCH] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-22T17:27:38Z","receivedAt":"2026-09-22T17:27:40Z","isPatch":true,"body":"Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n\n> The default expiry periods for reflog entries are reversed in\n> REFLOG_EXPIRE_OPTIONS_INIT(). This causes reachable entries to\n> expire after 30 days instead of the documented 90 days.\n>\n> Restore the intended 90-day expiry for reachable entries and\n> 30-day expiry for unreachable entries.\n>\n> Add a regression test for a reachable reflog entry that is\n> 60 days old.\n\nDoes this breakage date back to the beginning of the reflog expire\nfeature, or was it working perfectly fine but was broken sometime\nago?  Do we know where the breakge happened, and why?  Those are a\nlot more relevant things to describe in the first paragraph.  Once\nthe problem is described clearly enough in a simple case like this,\nthe solution to the problem is so obvious that latter two paragraphs\ndo not need to be said.\n\n> Reported-by: r.norouzi <r.norouzi@proton.me>\n> Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n> ---\n>  reflog.h          |  4 ++--\n>  t/t1410-reflog.sh | 13 +++++++++++++\n>  2 files changed, 15 insertions(+), 2 deletions(-)\n\n> diff --git a/reflog.h b/reflog.h\n> index b996712c00..3bdd1ca8a5 100644\n> --- a/reflog.h\n> +++ b/reflog.h\n> @@ -23,8 +23,8 @@ struct reflog_expire_options {\n>  \tint recno;\n>  };\n>  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n>  }\n>  \n>  /*\n> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\n> index 8f78cf4b01..1239c078ef 100755\n> --- a/t/t1410-reflog.sh\n> +++ b/t/t1410-reflog.sh\n> @@ -153,6 +153,19 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n>  \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n>  '\n>  \n> +test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n> +\ttest_when_finished \"rm -rf repo\" &&\n> +\tgit init repo &&\n> +\t(\n> +\t\tcd repo &&\n> +\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\tgit reflog expire --all &&\n> +\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n> +\t)\n> +'\n\nDo you also want to see what happens to entries that point at\nunreachable objects that is say 20 days and 40 days old,\nrespectively, plus an entry that points at a reachable object that\nis 100 days old?  \"Keeping\" is \"not expiring\" and driven by the same\nlogic, so it is better to test both sides of the same coin, isn't it?\n\n>  test_expect_success 'corrupt and check' '\n>  \n>  \tcorrupt $F &&\n\nThanks.\n"},{"id":"553005","messageId":"20260922180251.GA18803@coredump.intra.peff.net","threadId":"66354","inReplyTo":"xmqq5wzxfb79.fsf@gitster.g","subject":"Re: [PATCH] reflog: fix default expiry periods","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-09-22T18:02:51Z","receivedAt":"2026-09-22T18:02:59Z","isPatch":true,"body":"On Tue, Sep 22, 2026 at 10:27:38AM -0700, Junio C Hamano wrote:\n\n> Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n> \n> > The default expiry periods for reflog entries are reversed in\n> > REFLOG_EXPIRE_OPTIONS_INIT(). This causes reachable entries to\n> > expire after 30 days instead of the documented 90 days.\n> >\n> > Restore the intended 90-day expiry for reachable entries and\n> > 30-day expiry for unreachable entries.\n> >\n> > Add a regression test for a reachable reflog entry that is\n> > 60 days old.\n> \n> Does this breakage date back to the beginning of the reflog expire\n> feature, or was it working perfectly fine but was broken sometime\n> ago?  Do we know where the breakge happened, and why?  Those are a\n> lot more relevant things to describe in the first paragraph.  Once\n> the problem is described clearly enough in a simple case like this,\n> the solution to the problem is so obvious that latter two paragraphs\n> do not need to be said.\n\nI had the same question. They were flipped by 8565827570\n(builtin/reflog: stop storing default reflog expiry dates globally,\n2025-04-08). That definitely should go in the commit message.\n\n-Peff\n"},{"id":"553040","messageId":"20260923102140.25475-2-pushkarkumarsingh1970@gmail.com","threadId":"66354","inReplyTo":"20260922165433.591551-2-pushkarkumarsingh1970@gmail.com","subject":"[PATCH v2] reflog: fix default expiry periods","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-09-23T10:21:41Z","receivedAt":"2026-09-23T10:22:31Z","isPatch":true,"body":"The default reflog expiry periods were swapped when they were moved to\nREFLOG_EXPIRE_OPTIONS_INIT() by 85658275702b (builtin/reflog: stop storing\ndefault reflog expiry dates globally).\n\nThis caused reachable entries to expire after 30 days instead of 90 days,\nand unreachable entries after 90 days instead of 30 days.\n\nReported-by: r.norouzi <r.norouzi@proton.me>\nSigned-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n---\nChanges in v2:\n- Expand the regression test to cover both reachable and unreachable\n  entries before and after their respective expiry periods.\n\n reflog.h          |  4 ++--\n t/t1410-reflog.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 47 insertions(+), 2 deletions(-)\n\ndiff --git a/reflog.h b/reflog.h\nindex b996712c00..3bdd1ca8a5 100644\n--- a/reflog.h\n+++ b/reflog.h\n@@ -23,8 +23,8 @@ struct reflog_expire_options {\n \tint recno;\n };\n #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n-\t.default_expire_total = now - 30 * 24 * 3600, \\\n-\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n+\t.default_expire_total = now - 90 * 24 * 3600, \\\n+\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n }\n \n /*\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 8f78cf4b01..c494aa5ef0 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -153,6 +153,51 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n '\n \n+test_expect_success 'reflog expire uses the correct default expiry periods' '\n+\ttest_when_finished \"rm -rf reachable-keep reachable-expire unreachable\" &&\n+\tgit init reachable-keep &&\n+\t(\n+\t\tcd reachable-keep &&\n+\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\tgit reflog expire --all &&\n+\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n+\t) &&\n+\tgit init reachable-expire &&\n+\t(\n+\t\tcd reachable-expire &&\n+\t\ttimestamp=$(test-tool date timestamp \"100.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\tgit reflog expire --all &&\n+\t\ttest_stdout_line_count = 0 git reflog refs/heads/main\n+\t) &&\n+\tgit init unreachable &&\n+\t(\n+\t\tcd unreachable &&\n+\t\ttest_commit --no-tag base &&\n+\t\tbase=$(git rev-parse HEAD) &&\n+\t\ttimestamp=$(test-tool date timestamp \"20.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old-20 &&\n+\t\told20=$(git rev-parse HEAD) &&\n+\t\tgit update-ref refs/heads/main \"$base\" &&\n+\t\ttimestamp=$(test-tool date timestamp \"40.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old-40 &&\n+\t\told40=$(git rev-parse HEAD) &&\n+\t\tgit update-ref refs/heads/main \"$base\" &&\n+\t\tgit rev-list --all --objects >reachable &&\n+\t\ttest_grep ! \"$old20\" reachable &&\n+\t\ttest_grep ! \"$old40\" reachable &&\n+\t\tgit reflog expire --all &&\n+\t\tgit reflog --format='%H' refs/heads/main >actual &&\n+\t\ttest_grep \"$old20\" actual &&\n+\t\ttest_grep ! \"$old40\" actual\n+\t)\n+'\n+\n test_expect_success 'corrupt and check' '\n \n \tcorrupt $F &&\n-- \n2.53.0\n\n"},{"id":"553042","messageId":"arPEOdE9SKyOd8EJ@pks.im","threadId":"66354","inReplyTo":"20260922180251.GA18803@coredump.intra.peff.net","subject":"Re: [PATCH] reflog: fix default expiry periods","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-23T12:21:13Z","receivedAt":"2026-09-23T12:21:34Z","isPatch":true,"body":"On Tue, Sep 22, 2026 at 02:02:51PM -0400, Jeff King wrote:\n> On Tue, Sep 22, 2026 at 10:27:38AM -0700, Junio C Hamano wrote:\n> \n> > Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n> > \n> > > The default expiry periods for reflog entries are reversed in\n> > > REFLOG_EXPIRE_OPTIONS_INIT(). This causes reachable entries to\n> > > expire after 30 days instead of the documented 90 days.\n> > >\n> > > Restore the intended 90-day expiry for reachable entries and\n> > > 30-day expiry for unreachable entries.\n> > >\n> > > Add a regression test for a reachable reflog entry that is\n> > > 60 days old.\n> > \n> > Does this breakage date back to the beginning of the reflog expire\n> > feature, or was it working perfectly fine but was broken sometime\n> > ago?  Do we know where the breakge happened, and why?  Those are a\n> > lot more relevant things to describe in the first paragraph.  Once\n> > the problem is described clearly enough in a simple case like this,\n> > the solution to the problem is so obvious that latter two paragraphs\n> > do not need to be said.\n> \n> I had the same question. They were flipped by 8565827570\n> (builtin/reflog: stop storing default reflog expiry dates globally,\n> 2025-04-08). That definitely should go in the commit message.\n\nOops, indeed. Thanks for finding this issue and fixing it!\n\nPatrick\n"},{"id":"553103","messageId":"xmqqpky3ahvo.fsf@gitster.g","threadId":"66354","inReplyTo":"20260923102140.25475-2-pushkarkumarsingh1970@gmail.com","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-23T19:26:51Z","receivedAt":"2026-09-23T19:26:53Z","isPatch":true,"body":"Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n\n> The default reflog expiry periods were swapped when they were moved to\n> REFLOG_EXPIRE_OPTIONS_INIT() by 85658275702b (builtin/reflog: stop storing\n> default reflog expiry dates globally).\n>\n> This caused reachable entries to expire after 30 days instead of 90 days,\n> and unreachable entries after 90 days instead of 30 days.\n>\n> Reported-by: r.norouzi <r.norouzi@proton.me>\n> Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n> ---\n\nThe above reads very well.\n\n>  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n>  }\n\nand the fix is very straight-forward.\n\n> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\n> index 8f78cf4b01..c494aa5ef0 100755\n> --- a/t/t1410-reflog.sh\n> +++ b/t/t1410-reflog.sh\n> @@ -153,6 +153,51 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n>  \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n>  '\n>  \n> +test_expect_success 'reflog expire uses the correct default expiry periods' '\n> +\ttest_when_finished \"rm -rf reachable-keep reachable-expire unreachable\" &&\n> +\tgit init reachable-keep &&\n> +\t(\n> +\t\tcd reachable-keep &&\n> +\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\tgit reflog expire --all &&\n> +\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n> +\t) &&\n> +\tgit init reachable-expire &&\n> +\t(\n> +\t\tcd reachable-expire &&\n> +\t\ttimestamp=$(test-tool date timestamp \"100.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\tgit reflog expire --all &&\n> +\t\ttest_stdout_line_count = 0 git reflog refs/heads/main\n> +\t) &&\n> +\tgit init unreachable &&\n> +\t(\n> +\t\tcd unreachable &&\n> +\t\ttest_commit --no-tag base &&\n> +\t\tbase=$(git rev-parse HEAD) &&\n> +\t\ttimestamp=$(test-tool date timestamp \"20.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old-20 &&\n> +\t\told20=$(git rev-parse HEAD) &&\n> +\t\tgit update-ref refs/heads/main \"$base\" &&\n> +\t\ttimestamp=$(test-tool date timestamp \"40.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old-40 &&\n> +\t\told40=$(git rev-parse HEAD) &&\n> +\t\tgit update-ref refs/heads/main \"$base\" &&\n> +\t\tgit rev-list --all --objects >reachable &&\n> +\t\ttest_grep ! \"$old20\" reachable &&\n> +\t\ttest_grep ! \"$old40\" reachable &&\n> +\t\tgit reflog expire --all &&\n> +\t\tgit reflog --format='%H' refs/heads/main >actual &&\n> +\t\ttest_grep \"$old20\" actual &&\n> +\t\ttest_grep ! \"$old40\" actual\n> +\t)\n> +'\n\nThis one is curious in a few ways.\n\nFor reachable ones before and after the cut-off timestamp, we have\nseparate blocks to test them independently, but for unreachable\nones, we dedicatge only one block.  Is there a good reason for this\ndistinction?\n\nAs some people worry about repository set-up and tear-down cost, it\nmay please them more if you create a single test repository, prepare\nfour cases in it, and test them with a single \"reflog expire --all\".\n\nOn the other hand, it makes it easier to debug these tests if you\ncreate one test repository for each of the four cases and test them\nindependently, but if we are going that route, we would rather want\nto have one \"test_expect_success\" block for each of these four\ncases.\n\nThis \"one test_expect_success block that has three repositories, one\nis used to test two cases and each of the other two is used to test\nthe remaining two cases separately\" arrangement looks puzzling.\n\n"},{"id":"553190","messageId":"arUvtE67n5_MFM4C@pks.im","threadId":"66354","inReplyTo":"xmqqpky3ahvo.fsf@gitster.g","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-24T14:12:04Z","receivedAt":"2026-09-24T14:12:10Z","isPatch":true,"body":"On Wed, Sep 23, 2026 at 12:26:51PM -0700, Junio C Hamano wrote:\n> Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n> \n> > The default reflog expiry periods were swapped when they were moved to\n> > REFLOG_EXPIRE_OPTIONS_INIT() by 85658275702b (builtin/reflog: stop storing\n> > default reflog expiry dates globally).\n> >\n> > This caused reachable entries to expire after 30 days instead of 90 days,\n> > and unreachable entries after 90 days instead of 30 days.\n> >\n> > Reported-by: r.norouzi <r.norouzi@proton.me>\n> > Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n> > ---\n> \n> The above reads very well.\n> \n> >  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> > -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> > -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> > +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> > +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n> >  }\n> \n> and the fix is very straight-forward.\n\nIs this something that we want to fast-track for Git 2.56?\n\nPatrick\n"},{"id":"553201","messageId":"20260924154659.GA736248@coredump.intra.peff.net","threadId":"66354","inReplyTo":"arUvtE67n5_MFM4C@pks.im","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-09-24T15:46:59Z","receivedAt":"2026-09-24T15:47:02Z","isPatch":true,"body":"On Thu, Sep 24, 2026 at 04:12:04PM +0200, Patrick Steinhardt wrote:\n\n> > >  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> > > -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> > > -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> > > +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> > > +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n> > >  }\n> > \n> > and the fix is very straight-forward.\n> \n> Is this something that we want to fast-track for Git 2.56?\n\nThe breakage was in v2.50.0, so it is not a new regression. OTOH it\nseems quite obvious and low-risk. I'd be OK either way.\n\n-Peff\n"},{"id":"553215","messageId":"xmqqik3u35pq.fsf@gitster.g","threadId":"66354","inReplyTo":"arUvtE67n5_MFM4C@pks.im","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-24T17:43:45Z","receivedAt":"2026-09-24T17:43:48Z","isPatch":true,"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Wed, Sep 23, 2026 at 12:26:51PM -0700, Junio C Hamano wrote:\n>> Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n>> \n>> > The default reflog expiry periods were swapped when they were moved to\n>> > REFLOG_EXPIRE_OPTIONS_INIT() by 85658275702b (builtin/reflog: stop storing\n>> > default reflog expiry dates globally).\n>> >\n>> > This caused reachable entries to expire after 30 days instead of 90 days,\n>> > and unreachable entries after 90 days instead of 30 days.\n>> >\n>> > Reported-by: r.norouzi <r.norouzi@proton.me>\n>> > Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n>> > ---\n>> \n>> The above reads very well.\n>> \n>> >  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n>> > -\t.default_expire_total = now - 30 * 24 * 3600, \\\n>> > -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n>> > +\t.default_expire_total = now - 90 * 24 * 3600, \\\n>> > +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n>> >  }\n>> \n>> and the fix is very straight-forward.\n>\n> Is this something that we want to fast-track for Git 2.56?\n\nProbably.  The accompanied tests in the patch was not as nice as\nwhat is quoted above, if I recall correctly, though.\n"},{"id":"553216","messageId":"xmqqecei35n2.fsf@gitster.g","threadId":"66354","inReplyTo":"20260924154659.GA736248@coredump.intra.peff.net","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-24T17:45:21Z","receivedAt":"2026-09-24T17:45:23Z","isPatch":true,"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Sep 24, 2026 at 04:12:04PM +0200, Patrick Steinhardt wrote:\n>\n>> > >  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n>> > > -\t.default_expire_total = now - 30 * 24 * 3600, \\\n>> > > -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n>> > > +\t.default_expire_total = now - 90 * 24 * 3600, \\\n>> > > +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n>> > >  }\n>> > \n>> > and the fix is very straight-forward.\n>> \n>> Is this something that we want to fast-track for Git 2.56?\n>\n> The breakage was in v2.50.0, so it is not a new regression. OTOH it\n> seems quite obvious and low-risk. I'd be OK either way.\n\nYeah, I didn't know the breakage was that old.  Perhaps not many\npeople are paying attention to reflog expiration?\n\n"},{"id":"553217","messageId":"20260924175843.8383-2-pushkarkumarsingh1970@gmail.com","threadId":"66354","inReplyTo":"20260923102140.25475-2-pushkarkumarsingh1970@gmail.com","subject":"[PATCH v3] reflog: fix default expiry periods","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-09-24T17:58:44Z","receivedAt":"2026-09-24T17:59:35Z","isPatch":true,"body":"The default reflog expiry periods were swapped when they were moved to\nREFLOG_EXPIRE_OPTIONS_INIT() by 85658275702b (builtin/reflog: stop storing\ndefault reflog expiry dates globally).\n\nThis caused reachable entries to expire after 30 days instead of 90 days,\nand unreachable entries after 90 days instead of 30 days.\n\nReported-by: r.norouzi <r.norouzi@proton.me>\nSigned-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n---\nChanges in v3:\n- Split the regression test into four independent cases, covering\n  reachable and unreachable entries before and after their expiry periods.\n\n reflog.h          |  4 +--\n t/t1410-reflog.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 68 insertions(+), 2 deletions(-)\n\ndiff --git a/reflog.h b/reflog.h\nindex b996712c00..3bdd1ca8a5 100644\n--- a/reflog.h\n+++ b/reflog.h\n@@ -23,8 +23,8 @@ struct reflog_expire_options {\n \tint recno;\n };\n #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n-\t.default_expire_total = now - 30 * 24 * 3600, \\\n-\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n+\t.default_expire_total = now - 90 * 24 * 3600, \\\n+\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n }\n \n /*\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 8f78cf4b01..93b5b49e1d 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -153,6 +153,72 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n '\n \n+test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n+\ttest_when_finished \"rm -rf reachable-keep\" &&\n+\tgit init reachable-keep &&\n+\t(\n+\t\tcd reachable-keep &&\n+\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\tgit reflog expire --all &&\n+\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n+\t)\n+'\n+\n+test_expect_success 'reflog expire removes reachable entries after 90 days' '\n+\ttest_when_finished \"rm -rf reachable-expire\" &&\n+\tgit init reachable-expire &&\n+\t(\n+\t\tcd reachable-expire &&\n+\t\ttimestamp=$(test-tool date timestamp \"100.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\tgit reflog expire --all &&\n+\t\ttest_stdout_line_count = 0 git reflog refs/heads/main\n+\t)\n+'\n+\n+test_expect_success 'reflog expire keeps unreachable entries for 30 days' '\n+\ttest_when_finished \"rm -rf unreachable-keep\" &&\n+\tgit init unreachable-keep &&\n+\t(\n+\t\tcd unreachable-keep &&\n+\t\ttest_commit --no-tag base &&\n+\t\tbase=$(git rev-parse HEAD) &&\n+\t\ttimestamp=$(test-tool date timestamp \"20.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\told=$(git rev-parse HEAD) &&\n+\t\tgit update-ref refs/heads/main \"$base\" &&\n+\t\tgit rev-list --all --objects >reachable &&\n+\t\ttest_grep ! \"$old\" reachable &&\n+\t\tgit reflog expire --all &&\n+\t\tgit reflog --format='%H' refs/heads/main >actual &&\n+\t\ttest_grep \"$old\" actual\n+\t)\n+'\n+\n+test_expect_success 'reflog expire removes unreachable entries after 30 days' '\n+\ttest_when_finished \"rm -rf unreachable-expire\" &&\n+\tgit init unreachable-expire &&\n+\t(\n+\t\tcd unreachable-expire &&\n+\t\ttest_commit --no-tag base &&\n+\t\tbase=$(git rev-parse HEAD) &&\n+\t\ttimestamp=$(test-tool date timestamp \"40.days.ago\") &&\n+\t\ttimestamp=${timestamp#* -> } &&\n+\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n+\t\told=$(git rev-parse HEAD) &&\n+\t\tgit update-ref refs/heads/main \"$base\" &&\n+\t\tgit rev-list --all --objects >reachable &&\n+\t\ttest_grep ! \"$old\" reachable &&\n+\t\tgit reflog expire --all &&\n+\t\tgit reflog --format='%H' refs/heads/main >actual &&\n+\t\ttest_grep ! \"$old\" actual\n+\t)\n+'\n+\n test_expect_success 'corrupt and check' '\n \n \tcorrupt $F &&\n-- \n2.53.0\n\n"},{"id":"553221","messageId":"xmqqwlsa1p5d.fsf@gitster.g","threadId":"66354","inReplyTo":"20260924175843.8383-2-pushkarkumarsingh1970@gmail.com","subject":"Re: [PATCH v3] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-24T18:26:54Z","receivedAt":"2026-09-24T18:26:57Z","isPatch":true,"body":"Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:\n\n> The default reflog expiry periods were swapped when they were moved to\n> REFLOG_EXPIRE_OPTIONS_INIT() by 85658275702b (builtin/reflog: stop storing\n> default reflog expiry dates globally).\n>\n> This caused reachable entries to expire after 30 days instead of 90 days,\n> and unreachable entries after 90 days instead of 30 days.\n>\n> Reported-by: r.norouzi <r.norouzi@proton.me>\n> Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n> ---\n> Changes in v3:\n> - Split the regression test into four independent cases, covering\n>   reachable and unreachable entries before and after their expiry periods.\n>\n>  reflog.h          |  4 +--\n>  t/t1410-reflog.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++\n>  2 files changed, 68 insertions(+), 2 deletions(-)\n\n\nThis iteration has its tests much more nicely organized than the\nprevious round.  Looking very good.\n\nAfter this patch graduates to 'master' and the dust settles, we\nmight want to clean-up the repetitive and verbose combinations of\nturning a human-readable timespec into a machine-usable timestamp\ninto a single helper that is easier to use.  But that is outside the\nscope of this change, I would say.\n\n> diff --git a/reflog.h b/reflog.h\n> index b996712c00..3bdd1ca8a5 100644\n> --- a/reflog.h\n> +++ b/reflog.h\n> @@ -23,8 +23,8 @@ struct reflog_expire_options {\n>  \tint recno;\n>  };\n>  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n>  }\n>  \n>  /*\n> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\n> index 8f78cf4b01..93b5b49e1d 100755\n> --- a/t/t1410-reflog.sh\n> +++ b/t/t1410-reflog.sh\n> @@ -153,6 +153,72 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n>  \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n>  '\n>  \n> +test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n> +\ttest_when_finished \"rm -rf reachable-keep\" &&\n> +\tgit init reachable-keep &&\n> +\t(\n> +\t\tcd reachable-keep &&\n> +\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\tgit reflog expire --all &&\n> +\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n> +\t)\n> +'\n> +\n> +test_expect_success 'reflog expire removes reachable entries after 90 days' '\n> +\ttest_when_finished \"rm -rf reachable-expire\" &&\n> +\tgit init reachable-expire &&\n> +\t(\n> +\t\tcd reachable-expire &&\n> +\t\ttimestamp=$(test-tool date timestamp \"100.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\tgit reflog expire --all &&\n> +\t\ttest_stdout_line_count = 0 git reflog refs/heads/main\n> +\t)\n> +'\n> +\n> +test_expect_success 'reflog expire keeps unreachable entries for 30 days' '\n> +\ttest_when_finished \"rm -rf unreachable-keep\" &&\n> +\tgit init unreachable-keep &&\n> +\t(\n> +\t\tcd unreachable-keep &&\n> +\t\ttest_commit --no-tag base &&\n> +\t\tbase=$(git rev-parse HEAD) &&\n> +\t\ttimestamp=$(test-tool date timestamp \"20.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\told=$(git rev-parse HEAD) &&\n> +\t\tgit update-ref refs/heads/main \"$base\" &&\n> +\t\tgit rev-list --all --objects >reachable &&\n> +\t\ttest_grep ! \"$old\" reachable &&\n> +\t\tgit reflog expire --all &&\n> +\t\tgit reflog --format='%H' refs/heads/main >actual &&\n> +\t\ttest_grep \"$old\" actual\n> +\t)\n> +'\n> +\n> +test_expect_success 'reflog expire removes unreachable entries after 30 days' '\n> +\ttest_when_finished \"rm -rf unreachable-expire\" &&\n> +\tgit init unreachable-expire &&\n> +\t(\n> +\t\tcd unreachable-expire &&\n> +\t\ttest_commit --no-tag base &&\n> +\t\tbase=$(git rev-parse HEAD) &&\n> +\t\ttimestamp=$(test-tool date timestamp \"40.days.ago\") &&\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\told=$(git rev-parse HEAD) &&\n> +\t\tgit update-ref refs/heads/main \"$base\" &&\n> +\t\tgit rev-list --all --objects >reachable &&\n> +\t\ttest_grep ! \"$old\" reachable &&\n> +\t\tgit reflog expire --all &&\n> +\t\tgit reflog --format='%H' refs/heads/main >actual &&\n> +\t\ttest_grep ! \"$old\" actual\n> +\t)\n> +'\n> +\n>  test_expect_success 'corrupt and check' '\n>  \n>  \tcorrupt $F &&\n"},{"id":"553224","messageId":"20260924184331.GB747880@coredump.intra.peff.net","threadId":"66354","inReplyTo":"xmqqecei35n2.fsf@gitster.g","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-09-24T18:43:31Z","receivedAt":"2026-09-24T18:43:34Z","isPatch":true,"body":"On Thu, Sep 24, 2026 at 10:45:21AM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > On Thu, Sep 24, 2026 at 04:12:04PM +0200, Patrick Steinhardt wrote:\n> >\n> >> > >  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> >> > > -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> >> > > -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> >> > > +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> >> > > +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n> >> > >  }\n> >> > \n> >> > and the fix is very straight-forward.\n> >> \n> >> Is this something that we want to fast-track for Git 2.56?\n> >\n> > The breakage was in v2.50.0, so it is not a new regression. OTOH it\n> > seems quite obvious and low-risk. I'd be OK either way.\n> \n> Yeah, I didn't know the breakage was that old.  Perhaps not many\n> people are paying attention to reflog expiration?\n\nQuite probably. The default expiration dates are somewhat arbitrary, and\nthe reflogs themselves are somewhat ephemeral. Probably people would\nnotice most on stashes, but those are also somewhat ephemeral.\n\n-Peff\n"},{"id":"553408","messageId":"aroO0x0Ptp09ncx_@pks.im","threadId":"66354","inReplyTo":"20260924184331.GB747880@coredump.intra.peff.net","subject":"Re: [PATCH v2] reflog: fix default expiry periods","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-28T06:53:07Z","receivedAt":"2026-09-28T06:53:12Z","isPatch":true,"body":"On Thu, Sep 24, 2026 at 02:43:31PM -0400, Jeff King wrote:\n> On Thu, Sep 24, 2026 at 10:45:21AM -0700, Junio C Hamano wrote:\n> > Jeff King <peff@peff.net> writes:\n> > > On Thu, Sep 24, 2026 at 04:12:04PM +0200, Patrick Steinhardt wrote:\n> > >\n> > >> > >  #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \\\n> > >> > > -\t.default_expire_total = now - 30 * 24 * 3600, \\\n> > >> > > -\t.default_expire_unreachable = now - 90 * 24 * 3600, \\\n> > >> > > +\t.default_expire_total = now - 90 * 24 * 3600, \\\n> > >> > > +\t.default_expire_unreachable = now - 30 * 24 * 3600, \\\n> > >> > >  }\n> > >> > \n> > >> > and the fix is very straight-forward.\n> > >> \n> > >> Is this something that we want to fast-track for Git 2.56?\n> > >\n> > > The breakage was in v2.50.0, so it is not a new regression. OTOH it\n> > > seems quite obvious and low-risk. I'd be OK either way.\n> > \n> > Yeah, I didn't know the breakage was that old.  Perhaps not many\n> > people are paying attention to reflog expiration?\n> \n> Quite probably. The default expiration dates are somewhat arbitrary, and\n> the reflogs themselves are somewhat ephemeral. Probably people would\n> notice most on stashes, but those are also somewhat ephemeral.\n\nOh, I didn't realize that, either. In that case I agree it's not\nnecessary to fast-track this. Thanks!\n\nPatrick\n"},{"id":"553410","messageId":"aroQ_zZvUXKKK7--@pks.im","threadId":"66354","inReplyTo":"20260924175843.8383-2-pushkarkumarsingh1970@gmail.com","subject":"Re: [PATCH v3] reflog: fix default expiry periods","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-28T07:02:23Z","receivedAt":"2026-09-28T07:02:29Z","isPatch":true,"body":"On Thu, Sep 24, 2026 at 05:58:44PM +0000, Pushkar Singh wrote:\n> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\n> index 8f78cf4b01..93b5b49e1d 100755\n> --- a/t/t1410-reflog.sh\n> +++ b/t/t1410-reflog.sh\n> @@ -153,6 +153,72 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n>  \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n>  '\n>  \n> +test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n> +\ttest_when_finished \"rm -rf reachable-keep\" &&\n> +\tgit init reachable-keep &&\n> +\t(\n> +\t\tcd reachable-keep &&\n> +\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n\nNit: I would've preferred to make this 89 days...\n\n> +\t\ttimestamp=${timestamp#* -> } &&\n> +\t\ttest_commit --no-tag --date \"$timestamp +0000\" old &&\n> +\t\tgit reflog expire --all &&\n> +\t\ttest_stdout_line_count = 1 git reflog refs/heads/main\n> +\t)\n> +'\n> +\n> +test_expect_success 'reflog expire removes reachable entries after 90 days' '\n> +\ttest_when_finished \"rm -rf reachable-expire\" &&\n> +\tgit init reachable-expire &&\n> +\t(\n> +\t\tcd reachable-expire &&\n> +\t\ttimestamp=$(test-tool date timestamp \"100.days.ago\") &&\n\n... and this here exactly 90 days so that our test is a lot more narrow.\nSame for the subsequent test, where we could've made it 29 and 30 days,\nrespectively. But I don't think that this necessitates a reroll.\n\nOther than that I'm happy with this patch, thanks!\n\nPatrick\n"},{"id":"553484","messageId":"xmqqy0clo2em.fsf@gitster.g","threadId":"66354","inReplyTo":"aroQ_zZvUXKKK7--@pks.im","subject":"Re: [PATCH v3] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-28T14:50:57Z","receivedAt":"2026-09-28T14:51:00Z","isPatch":true,"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Thu, Sep 24, 2026 at 05:58:44PM +0000, Pushkar Singh wrote:\n>> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\n>> index 8f78cf4b01..93b5b49e1d 100755\n>> --- a/t/t1410-reflog.sh\n>> +++ b/t/t1410-reflog.sh\n>> @@ -153,6 +153,72 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n>>  \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n>>  '\n>>  \n>> +test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n>> +\ttest_when_finished \"rm -rf reachable-keep\" &&\n>> +\tgit init reachable-keep &&\n>> +\t(\n>> +\t\tcd reachable-keep &&\n>> +\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n>\n> Nit: I would've preferred to make this 89 days...\n\nDates calculated as 89 days ago from the beginning of today, from\nthe end of today, and from this very minute can differ by almost 24\nhours.  Because we are not interested in testing what semantics\napproxidate() implements in test-tool date timestamp, but are\ntesting what expiry period reflog expire implements between 30 and\n90 days, using numbers that are not too close to the edge spares us\nfrom having to worry about boundary cases we do not care about.\n\nSo I wouldn't have preferred using 89 days there.\n\n> Other than that I'm happy with this patch, thanks!\n>\n> Patrick\n\nThanks.\n"},{"id":"553542","messageId":"artQhZKf6JuRhmRl@pks.im","threadId":"66354","inReplyTo":"xmqqy0clo2em.fsf@gitster.g","subject":"Re: [PATCH v3] reflog: fix default expiry periods","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-29T05:45:41Z","receivedAt":"2026-09-29T05:45:47Z","isPatch":true,"body":"On Mon, Sep 28, 2026 at 07:50:57AM -0700, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > On Thu, Sep 24, 2026 at 05:58:44PM +0000, Pushkar Singh wrote:\n> >> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\n> >> index 8f78cf4b01..93b5b49e1d 100755\n> >> --- a/t/t1410-reflog.sh\n> >> +++ b/t/t1410-reflog.sh\n> >> @@ -153,6 +153,72 @@ test_expect_success 'reflog expire should not barf on an annotated tag' '\n> >>  \ttest_grep ! \"error: [Oo]bject .* not a commit\" err\n> >>  '\n> >>  \n> >> +test_expect_success 'reflog expire keeps reachable entries for 90 days' '\n> >> +\ttest_when_finished \"rm -rf reachable-keep\" &&\n> >> +\tgit init reachable-keep &&\n> >> +\t(\n> >> +\t\tcd reachable-keep &&\n> >> +\t\ttimestamp=$(test-tool date timestamp \"60.days.ago\") &&\n> >\n> > Nit: I would've preferred to make this 89 days...\n> \n> Dates calculated as 89 days ago from the beginning of today, from\n> the end of today, and from this very minute can differ by almost 24\n> hours.  Because we are not interested in testing what semantics\n> approxidate() implements in test-tool date timestamp, but are\n> testing what expiry period reflog expire implements between 30 and\n> 90 days, using numbers that are not too close to the edge spares us\n> from having to worry about boundary cases we do not care about.\n> \n> So I wouldn't have preferred using 89 days there.\n\nFair enough. I just find it a bit fishy to assert that we \"[keep]\nreachable entries for 90 days\" by checking that we keep it for 60 days\nbut throw it away after 100 days. THat allows for a very wide range of\nvalues that aren't 90 days.\n\nSo even if it shouldn't be 89 days, it could very well have been 88 days\nwithout any risk for test flakiness.\n\nPatrick\n"},{"id":"553626","messageId":"xmqqfqyrhpud.fsf@gitster.g","threadId":"66354","inReplyTo":"artQhZKf6JuRhmRl@pks.im","subject":"Re: [PATCH v3] reflog: fix default expiry periods","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-29T18:31:06Z","receivedAt":"2026-09-29T18:31:08Z","isPatch":true,"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> So even if it shouldn't be 89 days, it could very well have been 88 days\n> without any risk for test flakiness.\n\nThat's fair.\n\nThanks.\n"}]}