Re: [PATCH v3] reflog: fix default expiry periods
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 28, 2026, 14:50 UTC
- Message-ID
- <xmqqy0clo2em.fsf@gitster.g>
- In-Reply-To
- <aroQ_zZvUXKKK7--@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 17 quoted lines
> On Thu, Sep 24, 2026 at 05:58:44PM +0000, Pushkar Singh wrote: >> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh >> index 8f78cf4b01..93b5b49e1d 100755 >> --- a/t/t1410-reflog.sh >> +++ b/t/t1410-reflog.sh >> @@ -153,6 +153,72 @@ test_expect_success 'reflog expire should not barf on an annotated tag' ' >> test_grep ! "error: [Oo]bject .* not a commit" err >> ' >> >> +test_expect_success 'reflog expire keeps reachable entries for 90 days' ' >> + test_when_finished "rm -rf reachable-keep" && >> + git init reachable-keep && >> + ( >> + cd reachable-keep && >> + timestamp=$(test-tool date timestamp "60.days.ago") && > > Nit: I would've preferred to make this 89 days...
Dates calculated as 89 days ago from the beginning of today, from the end of today, and from this very minute can differ by almost 24 hours. Because we are not interested in testing what semantics approxidate() implements in test-tool date timestamp, but are testing what expiry period reflog expire implements between 30 and 90 days, using numbers that are not too close to the edge spares us from having to worry about boundary cases we do not care about.
So I wouldn't have preferred using 89 days there.
> Other than that I'm happy with this patch, thanks! > > Patrick
Thanks.