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

Re: [PATCH v2] push: fix --force-if-includes when remote-tracking ref has no reflog

From
Aleksei Sviridkin <f@lex.la>
Date
Sep 10, 2026, 08:31 UTC
Message-ID
<20260910083106.88960-1-f@lex.la>
In-Reply-To
<xmqqv78dordu.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> Sorry but I am confused.  Your sample below is with 20000 local
> reflog worth of activities, which is hardly a "quiet repository".

Two things got joined there. The 20000 entries are the worst case for measuring the walk's cost. The repositories that keep entries older than 90 days are ordinary ones where "git gc --auto" never crossed 6700 loose objects, and that needs no configuration.

> Doesn't that mean it is more logical to use the default gc
> expiration timeout than year 1970 and in any cases using the usual
> gc expiration would not waste more time than using 1970, right?

On time, yes. The cutoff never takes longer than zero. But it saves time only by ending the search early, and ending the search early is what rejects a valid push. Same repository, matching entry 200 days old: the cutoff rejects in 0.086s, zero accepts in 0.322s. Where the cutoff cannot change the verdict, both take the same time: 0.070s vs 0.069s after expiry, 0.319s vs 0.321s with everything inside 90 days.

The cutoff is faster than zero only where it gives the wrong answer. If that trade is acceptable, gc.reflogExpire is a one-line change, and the commit message should then say the fallback can still reject a correct push when the matching entry is older than the cutoff. Your call.

Previous: Junio C HamanoNext: Tyler Cipriani
Message 21 of 27 in “push: fix --force-if-includes when remote-tracking ref has no reflog”
  1. push: fix --force-if-includes when remote-tracking ref has no reflogAleksei Sviridkin, Sep 3, 2026
  2. Junio C HamanoSep 3, 2026
  3. Aleksei SviridkinSep 3, 2026
  4. Junio C HamanoSep 3, 2026
  5. Aleksei SviridkinSep 3, 2026
  6. Kristoffer HaugsbakkSep 4, 2026
  7. push: fix --force-if-includes when remote-tracking ref has no reflogAleksei Sviridkin, Sep 4, 2026
  8. Junio C HamanoSep 4, 2026
  9. Junio C HamanoSep 4, 2026
  10. push: fix --force-if-includes when remote-tracking ref has no reflogAleksei Sviridkin, Sep 5, 2026
  11. Aleksei SviridkinSep 5, 2026
  12. Junio C HamanoSep 6, 2026
  13. Kristoffer HaugsbakkSep 6, 2026
  14. Aleksei SviridkinSep 6, 2026
  15. Junio C HamanoSep 6, 2026
  16. Thomas BachemSep 7, 2026
  17. Weijie YuanSep 7, 2026
  18. Junio C HamanoSep 8, 2026
  19. Aleksei SviridkinSep 9, 2026
  20. Junio C HamanoSep 10, 2026
  21. Aleksei SviridkinSep 10, 2026
  22. Tyler CiprianiSep 25, 2026
  23. Junio C HamanoSep 25, 2026
  24. Tyler CiprianiSep 29, 2026
  25. push: fix --force-if-includes when remote-tracking ref has no reflogAleksei Sviridkin, Sep 29, 2026
  26. Junio C HamanoSep 29, 2026
  27. 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.