git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 16:54 UTC

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

From
Aleksei Sviridkin <f@lex.la>
Date
Sep 6, 2026, 16:50 UTC
Message-ID
<20260906165052.21780-1-f@lex.la>
In-Reply-To
<xmqq33vn5hsq.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> Which suggests to me that gc.reflogExpire or 90 days ago would be a
> lot more reasonable than year 1970 to use as a fallback cutoff date.

Entries older than 90 days do survive. The reflog expires when gc or "git reflog expire" runs, not on its own, so I could build a branch whose matching reflog entry is 200 days old and still sitting there.

A/B on one scenario with only the fallback differing: with now minus 90 days the push is rejected, with zero it goes through as a forced update. The branch was created at the remote tip 200 days ago, that entry being the matching one, rewound below the tip 150 days ago, one recent commit on top, so the tip is not an ancestor of anything newer.

It takes two crossings of the bound to bite, which is why my first two attempts to reproduce it failed. The match is tested before the cut-off, so the entry sitting at the bound is still inspected, and the merge-base fallback still covers the case where the tip is reachable from something collected. You need a non-matching entry past the bound and the tip unreachable from what was collected.

v3 went out a few hours before your mail; its third paragraph argues zero over "now" or a fixed age. Your call.

Previous: Kristoffer HaugsbakkNext: Junio C Hamano
Message 14 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.