Git development
 help / color / mirror / Atom feed
From: Aleksei Sviridkin <f@lex.la>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Aleksei Sviridkin <f@lex.la>
Subject: Re: [PATCH v2] push: fix --force-if-includes when remote-tracking ref has no reflog
Date: Thu, 10 Sep 2026 11:31:06 +0300	[thread overview]
Message-ID: <20260910083106.88960-1-f@lex.la> (raw)
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.

  reply	other threads:[~2026-09-10  8:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  1:05 [PATCH] push: fix --force-if-includes when remote-tracking ref has no reflog Aleksei Sviridkin
2026-09-03 16:16 ` Junio C Hamano
2026-09-03 20:00   ` Aleksei Sviridkin
2026-09-03 20:11     ` Junio C Hamano
2026-09-03 21:45       ` Aleksei Sviridkin
2026-09-04  1:03     ` Kristoffer Haugsbakk
2026-09-04 16:48     ` Junio C Hamano
2026-09-05 17:13       ` Aleksei Sviridkin
2026-09-06  9:39         ` Kristoffer Haugsbakk
2026-09-06 17:14           ` Junio C Hamano
2026-09-07  4:54             ` Thomas Bachem
2026-09-07  6:23               ` Weijie Yuan
2026-09-04 12:44 ` [PATCH v2] " Aleksei Sviridkin
2026-09-04 15:42   ` Junio C Hamano
2026-09-06  0:45     ` Junio C Hamano
2026-09-06 16:50       ` Aleksei Sviridkin
2026-09-08  3:47         ` Junio C Hamano
2026-09-09  6:56           ` Aleksei Sviridkin
2026-09-10  0:57             ` Junio C Hamano
2026-09-10  8:31               ` Aleksei Sviridkin [this message]
2026-09-05 17:13 ` [PATCH v3] " Aleksei Sviridkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260910083106.88960-1-f@lex.la \
    --to=f@lex.la \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox