From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCBE016CD33 for ; Sun, 21 Jun 2026 01:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782006533; cv=none; b=Fqy7vDPoqNa9y4uRGYVtzl4mOIa2TvXC8AnPyStHMjj7fXulJvEwB8//Wnznfur+TtEEStZMBAqHQqKc/cjN0XTdf+iQi+Jihh7SF3WROIZYqbeK9v7/n33kChvho2fhVwLwzMRCfzxsSuc7pWX10L3p9hF30NzbDegDA52pxgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782006533; c=relaxed/simple; bh=3MU+MJGjRUxrXjOIphh3sGgpfGKtbESlCoK2cfF+tzI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=kD98xwdPMfOeoF3+U/YPDaGuBX30F44wZwV4RpnBg+DIHQgNtIDsCWbe5vzbFxUNY/1xs64Xx8ORMZZDQpH8csGjQ24XqAaWWk+oRJyqX6XDqD//+yTBWwW5X2tdM80P11BRZw6kjKeGxQ8y+sbMpkwceAidhhK6vZd2Kih8jtI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=ELPULBAJ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YErl3fKo; arc=none smtp.client-ip=103.168.172.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="ELPULBAJ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YErl3fKo" Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id F1D2E1400051; Sat, 20 Jun 2026 21:48:50 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-07.internal (MEProxy); Sat, 20 Jun 2026 21:48:50 -0400 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=fm3; t=1782006530; x=1782092930; bh=I8YSi5gSAi wvwDIx/tlh0NbTuigCGhPPmaMopKjVhO0=; b=ELPULBAJ+Dnbg1xuDzBvnkrXMd rSqyKg+nuH21AEwjSCfUpmANKKdG4bLGy/99vgi5rHubp+ujHvv/nlTcQTAxBhni NdVAYlh4xo26h+SCfHL7JnMrJEMPWSO6gG9eO0scXZR0BfeiebgBDuumnPU4YDsJ MQcvLbf1nTxw4YvaOJvMRsgUXcTGTnQdtmqqJrFFxR77UQmCwi72ReF8ZI5/VxxW 4A4FOdJ7NrOCwO+xvdVTIaoQr/MAyCoBDdvMjrn/DLwEPN4oGDRpBQBUbeuK54oB QpKP6qdYSMUqDIkQRiLOnjb4aGorTfJlmJDXP4VdNI/UsnXw8K76O8Yy8teQ== 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=fm1; t= 1782006530; x=1782092930; bh=I8YSi5gSAiwvw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5/L0FAIu84fHzjW4EahNtavhvQ X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 20 Jun 2026 21:48:49 -0400 (EDT) From: Junio C Hamano To: Pablo Sabater Cc: git@vger.kernel.org, krka@spotify.com, ayu.chandekar@gmail.com, chandrapratap3519@gmail.com, christian.couder@gmail.com, jltobler@gmail.com, karthik.188@gmail.com, peff@peff.net, phillip.wood@dunelm.org.uk, siddharthasthana31@gmail.com, Kristofer Karlsson Subject: Re: [PATCH v6 2/3] revision: add peek functions for lookahead In-Reply-To: <20260620-ps-pre-commit-indent-v6-2-cdc6d8fd5fbc@gmail.com> (Pablo Sabater's message of "Sat, 20 Jun 2026 12:11:51 +0200") References: <20260613-ps-pre-commit-indent-v5-0-8d308efea63d@gmail.com> <20260620-ps-pre-commit-indent-v6-0-cdc6d8fd5fbc@gmail.com> <20260620-ps-pre-commit-indent-v6-2-cdc6d8fd5fbc@gmail.com> Date: Sat, 20 Jun 2026 18:48:48 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Pablo Sabater writes: > +int revision_has_commits_after (struct rev_info *revs, int n) > +{ > + struct topo_walk_info *info = revs->topo_walk_info; > + > + if (info) { > + int visible = 0; > + for (size_t i = 0; i < info->topo_queue.nr && visible < n; i++) { > + struct commit *c = info->topo_queue.array[i].data; > + if (get_commit_action(revs, c) == commit_show) > + visible++; > + } > + return visible > n-1; The loop needs to be rethought, perhaps with a better abstraction than ".nr is the number of elements in the queue and we can walk them over as a dense array", using prio_queue_for_each(), once this topic meets the kk/prio-queue-get-put-fusion topic. I see Kristofer is already on the CC: line. Depending on the done-ness of the topic, we may want to include the topic in the updated base for this topic to resolve semantic conflicts early, or the other way around (i.e., let this topic graduate first and then rebuild the prio-queue topic on top of the updated 'master'). Thanks.