From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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 7FBFA3AEF59 for ; Mon, 8 Jun 2026 21:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780954597; cv=none; b=S2nso6uwNe7ZyVz6UBpiEV7rOPQXb8MllGh8LHJRNdBKEG5hTLXpOIU9ev46drIgK0G0JVinNR3pPBGAZ2W7j6t2z+ogfGhwfzACugwOA2CKf14F5DoBcgXJMxDKd5X6UOkni1zDc95/gGV1PMI9E+DiWFY553tOX1fE8bNzC/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780954597; c=relaxed/simple; bh=7Tfqjt/t/u8ND9BeHFfMenoTO5ZVZCGX20ljzjFnfiE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=KGrqByWikL32+60I69CNZgECnLEjUoh8GIXyFXWittHS1pDnmJYySfqT+iFCOanoo594rN7nVS6acEK2tRlrzENq434TWheu2yEWqaAX/TbOS6EA2+NhVsSRAXHrRWolx+Mdif32QRfAvF/C9EHHpc1ATitih6wgqzoBbClfibg= 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=agowSJy4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MM4Pheu2; arc=none smtp.client-ip=202.12.124.153 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="agowSJy4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MM4Pheu2" Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5CD0A7A015B; Mon, 8 Jun 2026 17:36:35 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-08.internal (MEProxy); Mon, 08 Jun 2026 17:36:35 -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=1780954595; x=1781040995; bh=42SrW77VFG Lsxzo5E2KErXCfH7aDyQZFzPs4wTXiOa0=; b=agowSJy4q/OM1CC6b/a+RqYhNr suNQA1DZux4XieOoH8VTMYC/6pViUifXQPV+Xr28hGNp/XSy89roF+vPRSJACHzl R5DgxD03Yk19UH+TwLaXGMLeAvbMOFBjnMe0W7TRNtuH4hPENP3Lv88G+HPPJPKE QMVnKigMlE3heaRYrwKgbNVvEy2We/Qp2CmxlE0FBscTU2rWTia4Hb8oI5/PEQ0o fTEp+bfk5j/Tt5itr7qhjb8ODbx5ZqAJcdMAhdVCHT3gPkU0ct3opQiISlbF7rWb XXiVAeId5pyK5k3TFaPO4HHbVrZHDKeAD3zZQrWLoGsiu/jSPP4jjZx683LA== 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= 1780954595; x=1781040995; bh=42SrW77VFGLsxzo5E2KErXCfH7aDyQZFzP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sw X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jun 2026 17:36:34 -0400 (EDT) From: Junio C Hamano To: Tamir Duberstein Cc: git@vger.kernel.org, Karthik Nayak , Patrick Steinhardt , Victoria Dye , ZheNing Hu Subject: Re: [PATCH] ref-filter: restore prefix-scoped iteration In-Reply-To: <20260605-fix-git-branch-regression-v1-1-02f40ad40929@gmail.com> (Tamir Duberstein's message of "Fri, 05 Jun 2026 12:43:03 -0400") References: <20260605-fix-git-branch-regression-v1-1-02f40ad40929@gmail.com> Date: Mon, 08 Jun 2026 14:36:33 -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 Tamir Duberstein writes: > diff --git a/ref-filter.c b/ref-filter.c > index 1da4c0e60d..2388a57b39 100644 > --- a/ref-filter.c > +++ b/ref-filter.c > @@ -3315,19 +3315,31 @@ static int do_filter_refs(struct ref_filter *filter, unsigned int type, refs_for > prefix = "refs/tags/"; > > if (prefix) { Below, adding an extra call to get_main_ref_store(the_repository) makes one line unnecessarily split and harder to read. How about doing struct ref_store *store = get_main_ref_store(the_repository); upfront here, and then use that to replace these two calls of get_main_ref_store(the_repository)? > + if (filter->start_after) { > + struct ref_iterator *iter; > > + iter = refs_ref_iterator_begin( > + get_main_ref_store(the_repository), "", NULL, 0, > + 0); > > ret = start_ref_iterator_after(iter, filter->start_after); > + if (!ret) > + ret = do_for_each_ref_iterator(iter, fn, > + cb_data); > + } else { > + /* > + * Pass the prefix during construction because the files > + * backend primes loose refs before a later seek can > + * narrow the iterator. > + */ > + struct refs_for_each_ref_options opts = { > + .prefix = prefix, > + }; > > + ret = refs_for_each_ref_ext( > + get_main_ref_store(the_repository), fn, cb_data, > + &opts); > + } > } else if (filter->kind & FILTER_REFS_REGULAR) {