From: Junio C Hamano <gitster@pobox.com>
To: Aleksei Sviridkin <f@lex.la>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] push: fix --force-if-includes when remote-tracking ref has no reflog
Date: Wed, 09 Sep 2026 17:57:01 -0700 [thread overview]
Message-ID: <xmqqv78dordu.fsf@gitster.g> (raw)
In-Reply-To: <20260909065639.47316-1-f@lex.la> (Aleksei Sviridkin's message of "Wed, 9 Sep 2026 09:56:39 +0300")
Aleksei Sviridkin <f@lex.la> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>> It is only true for those who conciously disable the gc, isn't it?
>
> No. The fallback is not about expiry, it is reached when the
> remote-tracking ref has no reflog, and a plain clone leaves it that
> way: after "git clone --no-local" on the files backend, "git reflog
> exists refs/remotes/origin/main" returns 1, with core.logAllRefUpdates
> at its default and gc untouched. The same source cloned with
> --ref-format=reftable gets one entry.
>
> Nothing expires on a calendar either. Entries go when "git reflog
> expire" runs, and "git gc --auto" decides by loose object count
> (gc.auto, 6700), so a quiet repository expires nothing.
Sorry but I am confused. Your sample below is with 20000 local
reflog worth of activities, which is hardly a "quiet repository".
Besides, we are talking about "push" so optimizing for a quiet
repository does not sound like a useful mentail exercise to do.
>> Doesn't it force a behaviour that would happen only to those people
>> who deliberately choose to ignore cutoff and who are willing to spend
>> cycles to go back to the beginning of history, to all users,
>> including those who do not make such customization, no?
>
> Measured that. One repository, 20000 entries in the local branch's
> reflog, remote-tracking ref without a reflog, both values reject the
> push so only the work differs. Median of 7 runs:
>
> entries spread over 200 days zero 0.325s 90 days 0.069s
> after "git reflog expire --all" zero 0.070s 90 days 0.069s
> 20000 entries inside 90 days zero 0.319s 90 days 0.321s
>
> The expire run left 5 of the 20000, since all but five are 100 to 200
> days old here. So the cost lands only on a repository that still holds
> entries older than 90 days, which is the one where gc has not run.
>
> In that repository, when the matching entry is one of the old ones, the
> same walk is what decides: zero accepts in 0.322s, 90 days rejects in
> 0.086s.
>
> With no match it is 0.26s of extra work for the same answer.
Thanks.
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?
next prev parent reply other threads:[~2026-09-10 0:57 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 [this message]
2026-09-10 8:31 ` Aleksei Sviridkin
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=xmqqv78dordu.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=f@lex.la \
--cc=git@vger.kernel.org \
/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