Re: [PATCH v3] reflog: fix default expiry periods
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 28, 2026, 07:02 UTC
- Message-ID
- <aroQ_zZvUXKKK7--@pks.im>
- In-Reply-To
- <20260924175843.8383-2-pushkarkumarsingh1970@gmail.com>
On Thu, Sep 24, 2026 at 05:58:44PM +0000, Pushkar Singh wrote:
Show 14 quoted lines
> 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...
Show 13 quoted lines
> + timestamp=${timestamp#* -> } &&
> + test_commit --no-tag --date "$timestamp +0000" old &&
> + git reflog expire --all &&
> + test_stdout_line_count = 1 git reflog refs/heads/main
> + )
> +'
> +
> +test_expect_success 'reflog expire removes reachable entries after 90 days' '
> + test_when_finished "rm -rf reachable-expire" &&
> + git init reachable-expire &&
> + (
> + cd reachable-expire &&
> + timestamp=$(test-tool date timestamp "100.days.ago") &&... and this here exactly 90 days so that our test is a lot more narrow. Same for the subsequent test, where we could've made it 29 and 30 days, respectively. But I don't think that this necessitates a reroll.
Other than that I'm happy with this patch, thanks!
Patrick