Thread (21 messages) flat view 21 messages, 5 authors, 5h ago

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

From: Aleksei Sviridkin <hidden>
Date: 2026-09-06 16:50:58

Junio C Hamano [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help