🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #2162

Re: [PATCH] describe: count the distance correctly when commit dates are skewed

#2162
From: Junio C Hamano
Date: Mon, 02 Nov 2026 17:03
25 lines
13772 bytes
Derrick Stolee <stolee@gmail.com> writes:

>>> +	struct prio_queue queue = { compare_commits_by_gen_then_commit_date };
>>>  	struct commit_name *n;
>>>  	struct possible_tag all_matches[MAX_TAGS];
>>>  	unsigned int match_cnt = 0, annotated_cnt = 0, cur_match;
>> 
>> ... I wonder whether we should also call `ensure_generations_valid()`
>> here. That function is very expensive in cases where we don't have a
>> commit graph as it backfills generation numbers, and it may have to walk
>> the complete commit graph to do so. But isn't that better compared to
>> silently yielding a potentially-wrong result?
> I came here to say exactly that. Even when a commit-graph exists, it can
> be slightly behind the object database and so we need to fix up the
> newest commits with generation number details.
>
> The biggest downside is that it becomes very slow when a commit-graph
> doesn't exist (it walks all reachable commits from the starting points)
> but that's typically better than giving an incorrect answer.

When we ended up spending the huge cost by doing this in a
repository without existing commit-graph or with an out of date
commit-graph, I wonder if it is possible to recoup the cost by
amortizing it over time by writing a commit-graph out?
Technical Details
Message-ID: <xmqqqzh3jhcy.fsf@gitster.g>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74196-linux-kernel-git=dewy.ru
References: <20261031065525.19883-2-torvalds@kernel.org> <auiGP4XhObUzC9vD@pks.im> <8fa4010d-d39f-4e78-ab01-be3e9d20a148@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74196-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] describe: count the distance correctly when commit
 dates are skewed
Date: Mon, 02 Nov 2026 09:03:25 -0800
Organization: Usenet Network
Message-ID: <xmqqqzh3jhcy.fsf@gitster.g>
References: <20261031065525.19883-2-torvalds@kernel.org>
	<auiGP4XhObUzC9vD@pks.im>
	<8fa4010d-d39f-4e78-ab01-be3e9d20a148@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="2993604"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:efBRsblQOLrmldMarADau+nCS6Q= sha256:GMyypAxO5yKoMbPkkk+BwmoriSoHMb4sC4E8t5zEVxQ=
	sha1:YLCuAkBT/uZ91NLD4CGQ7wLFXXg= sha256:zV01N9Esd65CV29hUmEdTrUGcY9dLovRJvdfSM86VAQ=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 9A38E1125F5; Mon,  2 Nov 2026 21:12:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.951
X-Spam-Status: No, score=-1.951 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pobox.com header.b=kfRX1oc8; dkim=pass (2048-bit key)
	header.d=messagingengine.com header.b=MadLDgWQ
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id xSFmyxLDcIN6;
	Mon,  2 Nov 2026 21:12:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-74196-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=pobox.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 48C301125E9; Mon,  2 Nov 2026 21:12:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 082B6C20B4; Mon,  2 Nov 2026 17:35:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793639014;
	b=rwd9wMEpoNicmRdoJ+p9SW1NzLT2xD92xh1KYarG3uDMdVf6KPNPibS8ROD7/idnkdBy
	 BkENbHagOF1whMoUZcwJgfUHjGcMULXdu+I9iYuPCM4isUHTBVOHXi4Gol8dfTbW3UK6S
	 fYvz7tDVKItQPDJQ+/FN7digaSFog6k8arcLhk1sOkLLCvUF/x6dVa6Jz0bDKYxzNUC6O
	 OEvkjDT15eS87QhpSXiC6Dt8s9Mr0NywWuUCPD5iP0VyFoL+2iWp1sev0yQ3AYMYa72hR
	 sdvxTrK7zt+uf5TJBFJrA+HfcDgTWEsd2J0bVVw0lkOKZtRAauXoKfBCJfBn6zvclEQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793639014;
	h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature:
	 DKIM-Signature:X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:
	 Message-Instance:X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:
	 X-ME-Proxy:Feedback-ID:Received:From:To:Cc:Subject:In-Reply-To:
	 References:Date:Message-ID:User-Agent:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type;
	bh=jNasaJGoF9Dy4qJ/hPpk3lzcIEdR6jG9X69pdd+SlQQ=;
	b=Ol0J24zR8otc8Kn3H7gq0djznrgm1XYoWwOdGOtCF2rx7ri97P7SLSmMwYtkmt0s4nUp
	 A6+6Yk4dscfl6wC4jFsng3siRsDrPi7NKDcDGgQtRm/m013HZv4YwnsA75hW/f2GnTTqe
	 aBsgqg+sgqdlcT14AQOuD+c4GsKvw4Gk/ot9U7Va00kyc6s2laNeGNo6CgtaRTq7ppyD7
	 RApImTGFgumowcsLUs8NZ7n9VJLxXhOJQrv0IVvIZT5ycxiEWfMtqPKvouu4FGMRDFXmk
	 iSKpat1uuHet/hOkhEm48EMJie4bM0lP3jH7M/vRfCpK3mME5Il2hACznBBUH6fd7OQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm1 header.b=kfRX1oc8;
	dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=MadLDgWQ;
	dmarc=pass header.from=pobox.com;
	spf=pass smtp.mailfrom=pobox.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0867660AED0F;
	Mon,  2 Nov 2026 17:03:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm1 header.b=kfRX1oc8;
	dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=MadLDgWQ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.146
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793639008;
	b=nuHFwcPLpA8xtONQ14QNb08nKBsY3QPvprjluBjMhXV8R6YtmvBd68BM4IYPqRy36Ts5
	 e+yRXLNC6bCD2aAJ9KuZm3ltRCR7hsNlGh7j+4kS9JgXhhlOPSVoWoANJ/nXHK8D1FBw0
	 txE1Pn0I2Z5j5F7234wK4gjH3qF5K28ut4ywSWVQ3AJMf9sMxP7naTDM0xafZnZ/T17TL
	 Uco+zZ8KqT2bgSMQAvlLqjXgLPzCJiiCYDDpm/2hHAc9+bP0ui7MqT2wUy/Y/okVNNMP5
	 QpDD/eP5XDqbgtkYMAeRonC7EUPNv7M1YwcjP+hph5YsPnm/kTPFPve2OOUu+henXOQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793639008;
	h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature:
	 X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance:
	 X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:
	 Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 User-Agent:MIME-Version:Content-Type;
	bh=jNasaJGoF9Dy4qJ/hPpk3lzcIEdR6jG9X69pdd+SlQQ=;
	b=vAn1tsAq+MTMThpDXldXN6Xc6LT6i4xaTFYdZVaugw7yfoD8aMZL369C5VryhNxU1fqt
	 TmkIngyAcyRJ1yyIykP3sCGhkh9nxKjfXp13zSkOqXzRsE0S+NRKi+VR49QUjlGze64C1
	 2FbBDhxklkUkFTYILmdQiSrezNzeawDFGa4WS4dAtI2TDCWr0FOMvHXMa63w5O0pYccNR
	 HXEGyco0YBvJZ2tkos+IQjaa9lQgcKw5B/EumM6v+tfHKqj2d91NwA7EFWBXuTsUHIyTP
	 Q/fRdiIlnEl7mOB25ooLFsQCELkz5jKK9yx9YbzNh29rxkikc0MlQt2D8YA2WkBEWPQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=pobox.com;
	spf=pass smtp.mailfrom=pobox.com;
	dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm1 header.b=kfRX1oc8;
	dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=MadLDgWQ;
	arc=none smtp.remote-ip=202.12.124.146
X-Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2D19606F3F5
	for <git@vger.kernel.org>; Mon,  2 Nov 2026 17:03:27 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B2D19606F3F5
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com
X-Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
	by mailfout.stl.internal (Postfix) with ESMTP id 16C661D0012C
	for <git@vger.kernel.org>; Mon,  2 Nov 2026 12:03:27 -0500 (EST)
X-Received: from phl-frontend-02 ([10.202.2.161])
  by phl-compute-06.internal (MEProxy); Mon, 02 Nov 2026 12:03:27 -0500
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc
	:cc:content-type:content-type:date:date:from:from:in-reply-to
	:in-reply-to:message-id:mime-version:references:reply-to:subject
	:subject:to:to; s=fm1; t=1793639006; x=1793725406; bh=jNasaJGoF9
	Dy4qJ/hPpk3lzcIEdR6jG9X69pdd+SlQQ=; b=kfRX1oc8xV4Wy9ML49zTPS8Uyk
	2MDOYNlqVedqVoelpNDsRnCy0C8UHPXn36JvMyaKRI7MkRqGZZIPIEPovhtumFDf
	Ys3HJx+yaMoqX44Fuc8M9LvNml1Tj7sAAW2nHnMcQvmGM810Fum2itzqg+S7OeIx
	jIM3DWPSyUDMyB4+lrvBxmj2sxJ4ZLxlRHzbYfMYp6HJ/yDhx5eHGZbzh9dQ7eBf
	f7MAdneUNxNc4f3W4TVSgJeC1y7vsiTX0qeKwclXGLzSCF5Nesn6we+WLzDOVDyN
	EqE8efsQFxoCwcUycEwSS0iiMDDJ+2csJmXncpFYQ0ElMAih1dqVrhO9FF+A==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1793639006; x=1793725406; bh=jNasaJGoF9Dy4qJ/hPpk3lzcIEdR6jG9X69
	pdd+SlQQ=; b=MadLDgWQjpgYrLofKRht16it9wGZYl1lMsLlbOGAQDkSbyQMB3q
	uR/flcOzU1xbgpihh3sA2XWfwxOQ+K0Ns5vKqDJesUad6tg7pkOIPVdAqcq+OZdg
	qBApgMkCHV07KYy5PJLBiEOBzhey6s8FqKZdjGHe8lWqi9HL8wIxyxe94O+H4QFX
	7dcxHre6pOE6hWMpcSOP5DXOOLYguhLXnLXDA2AaW+At8MMlfdXCkSVY4dOpJIyB
	UB2lpGXXdWjQ878vm+WPdrfTeyEhbnIkdSclj7thKC2wyxkyhbf725bAYxGVSxrS
	wVB036LW1Iq4WHRvYnePDDXbr3gGb+/wxZQ==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
	repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
	action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1793639006; d=pobox.com;
	mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
	rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
	s=fm1:rsa-sha256:LApmTPouyVt0/FdefNskWiu3bo15gnsPviUn7exymcXLXOM
	bVG0r7bGrZQ58sECFKGcbgtjkxYm0gNoODN08OjGCCDbyi+VtH8mmIGdXdalq6T1
	oJyoZWFLM2le83JU1AkpISaC1mZdAxUiHwjLvqYQLXEVAc/0bohVASHoeZzO2X28
	vt3WADFszExxX1g0xQk/+vwTBDSoa2rxk1e64cWPtN75VZdKP49JgmZhJixMfrtf
	q9CwhlPzP2wN6aAByTf47PQ3C+m4THqA7ZARCh+f//ZLX7hqc5NvNnN21ZFsU106
	pw9Qd4FcqSbYbrPpy1AbjLOLy4GsRbt49y26shw==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08;
	repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox;
	action=mi-m=1; hc=12;
	hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id,
	mime-version,references,subject,to,user-agent;
X-Message-Instance: m=1; h=sha256:3wkKlgAtpbWsnH0yj5r4yLdHEzF5Hzq/T7sN4Vhusko=:dTHrvdhsmqodPqkV4CsxdslkuLvpEiK9lTkc2VLt52E=;
X-ME-Sender: <xms:XsLoasVW-UAwTWD1EKgm9RbZjxwJyzjssv8jvfH-oIP-tH4hZyJwIw>
    <xme:XsLoaoDnjDNQIoWTNEjz6UFqqLjVfComJ8u7s-KgSeikMGF4StFbM4dRhX_iKaI2t
    Tiu5Cs2Iad8Zapp1RoeVuNmHHH1-wZssScf_F4MCxLBJz9pPTuDFLI>
X-ME-Received: <xmr:XsLoatyZeSkFgjpz4oZF7xDcIX9z4RIiUf4n5JNV_uIK27ITSLwGFgctKe0vZznbAH7af_iA4UPaKbJ6vG6OPseQEmT4m1yzo1Uf>
X-ME-Proxy-Cause: dmFkZTEl6AS//P8g276hz4dNGXZhcQYOEx7WSApGqJtY/p7XBxZcp/WtvovONjWPI+1W3k
    DBiFolj67PRYxORR64bvD7AamVZ8K3ctnIqqQHkB0EH9ljdeCj5nrRiHONYYefsbtAEzm1
    OjiXjvhky5DbvBsbUa9iMyYlQ76WRbShlS6OuQ2lKVxk0P5lsOlLfa8E9wjw1Q9q5X6b3m
    R+58pnwi5gY6EA9Ij3qiWQK7aAsA9i4+akOALd3aHZaujDwrMJ6H1zwCbQjKPQd9wKReZY
    uySlJ3K7gys1/t7EMgdVgXkFCZt851DhKBTHpwZ1LyVd52VSELIiSgGAuKvHIUo4lltcXz
    DTUBg6JCBzooZmd88vmQa1yVsN3x3QLYxmiCy6xMOcMfDwbYYwsIC3eLL4EtoQ8L3Q/36H
    sOufYfjWoWV//6+7aeM3eNAu984mAqNm0HnYprwwSWpzsDPATC/XTcDHAW26H1RbBH8eVM
    0oxknP3S42uAeViPft2MxTZdK+7xdtp0KqDwRaFHAA3HCrGgSf5kcYVM4JKke8OKQ7+/SX
    4p/xXVQ1ZqqGx97cIomLNbdXF7IjDAKh0hFcZso/UzKWwivIs5g4hXGXOI+ntH4Hc7zXiN
    chANv48HjCSaF7TRFGaf80X9yXGIJ8xiCagz4H0KiqSMWlN9cKnDvaVhUwFA
X-ME-Proxy: <xmx:XsLoalCunHCt_yQKUS1z4-5HAAwgUkx42xJhWYLRhvKKipMIUUsWXA>
    <xmx:XsLoaqaTczNCpc0-e4iy2GU3MXvEH1KBt0mUQvNrrTwmUW74BXhbRA>
    <xmx:XsLoatiCdtr6JOUsFsaX0lTCRHx2hYcahlacPfxTDNcwMBs6hQtn9A>
    <xmx:XsLoas7P9to2aFTIlBg6aVGkrO1FLVZ9Lst8CmYmKt0wMy0eejbLMQ>
    <xmx:XsLoasDxloj1E0qZ08GsOZMJz4C10DO443fZFQEeLaxIQEJpIhjP5wWm>
X-Feedback-ID: if26b431b:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 2 Nov 2026 12:03:26 -0500 (EST)
X-Cc: git@vger.kernel.org
X-In-Reply-To: <8fa4010d-d39f-4e78-ab01-be3e9d20a148@gmail.com> (Derrick
	Stolee's message of "Mon, 2 Nov 2026 09:20:25 -0500")
X-User-Agent: Gnus/5.13 (Gnus v5.13)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list