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

Re: [PATCH v3] reflog: fix default expiry periods

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 29, 2026, 05:45 UTC
Message-ID
<artQhZKf6JuRhmRl@pks.im>
In-Reply-To
<xmqqy0clo2em.fsf@gitster.g>
On Mon, Sep 28, 2026 at 07:50:57AM -0700, Junio C Hamano wrote:
Show 29 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > 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.

Fair enough. I just find it a bit fishy to assert that we "[keep] reachable entries for 90 days" by checking that we keep it for 60 days but throw it away after 100 days. THat allows for a very wide range of values that aren't 90 days.

So even if it shouldn't be 89 days, it could very well have been 88 days without any risk for test flakiness.

Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 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.