🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #2745

Re: [PATCH] builtin/reflog: expire --all and named refs in one loop

#2745
From: Junio C Hamano
Date: Mon, 09 Nov 2026 20:04
21 lines
13466 bytes
Patrick Steinhardt <ps@pks.im> writes:

2 Okay, so instead of carrying the logic around `refs_reflog_expire()`
> twice you instead now first gather all reflog names that we want to
> expire, and then we do that in a single step. That seems like a useful
> simplification to me.
>
> One thing I wonder though: now that we first gather reflog names, can't
> we also easily deduplicate them? For example if the same reflog name was
> given multiple times on the command line, or in case the reflog is
> included both via a command line argument and via "--all".
>
> So I wonder whether we should both sort and deduplicate entries here.

Very good point.  I cannot think of a reason why we should not
consider it a bug that the current two-loop model processes and
reports about the same thing twice, and the collect-then-process
model allows deduplication almost for free to address that bug.

Thanks.
Technical Details
Message-ID: <xmqqwlqlydo2.fsf@gitster.g>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74973-linux-kernel-git=dewy.ru
References: <20261108012213.89468-1-laveeshb@laveeshbansal.com> <avGU-Wjkd821PLc0@pks.im>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74973-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] builtin/reflog: expire --all and named refs in one loop
Date: Mon, 09 Nov 2026 12:04:29 -0800
Organization: Usenet Network
Message-ID: <xmqqwlqlydo2.fsf@gitster.g>
References: <20261108012213.89468-1-laveeshb@laveeshbansal.com>
	<avGU-Wjkd821PLc0@pks.im>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="439663"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:nFZtp/OWTlsUD5e9caAC7H9eKJM= sha256:pBKDNth7WRt0r3dQlCKbGfS1dRRJRAOhlsLhx6VQvvg=
	sha1:HRKsYcRlhIPUrOYUJSbI3yNNIJc= sha256:VDyc6R9c9T7ciRzjNc2POFk/lBPRVaotoq4AHlr5H9M=
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 0A622113909; Mon,  9 Nov 2026 23:06:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
	tests=[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=mId9dV8b; dkim=pass (2048-bit key)
	header.d=messagingengine.com header.b=DOKZNONi
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 oZ64PyaoDZvr;
	Mon,  9 Nov 2026 23:06:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=git+bounces-74973-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 31A50113900; Mon,  9 Nov 2026 23:06:34 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id CEEEF606BEE; Mon,  9 Nov 2026 20:04:37 +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=1794254673;
	b=il0snYsSDPmitaJvYI2QTeL6PqZgT8gRcgKebTorWfev3frK7fYcJwFLnfzfnNZKWkZo
	 TpUxvj01JAuZOET8moXN6WuoKDVw64OPiitXBF12dr3b2vBJjYtULXZNaz2Hq8leBi4nS
	 Ecyi7RFUN0y63pqCw4NPde/+Q+kDFWvwSepMZavnsQz0fzN/f8+OMEEpGxrw4qryJfbJB
	 Xx65O1zOqDxKH4NEeRmNzQoOcia2o96oznxPw8jXcdNLcVpfDZeO9xP1nCH891rV09Bhj
	 PYleO81YjycnhXyw6g7T9wyxggV8p33tKKFPFsCaVZVroRZegNr79WoEeCBtyOA9ihQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794254673;
	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=aXnw9NS0drSD+aXAu6WJUkClj/1AjrNrKLyBKqy+4VY=;
	b=UyYKhPny46SbqPh/LFMPI3/1qSUFo4kyzJoXYl0uPh/WqIF7H3BntRMFRA5iUt02ARKK
	 L/fkPh02JZFeT0BYZ2t3ud5IbSTpEPQQOMuk7MPzxv51sO7O5DVuyndcNAQDgZITVMaY8
	 3qQZTeg6YNG4WFMe5b+uat8EZik8CXtpXn7pINsOaTwTGWRKmadLNF7XmK/uUgFC8o0z5
	 mc3rBEx8KO6jsFl6wF5WiF6k76yAgC05Gavp6qLGowT5zh+vkC+xE4wM34pFhrxY8g1ls
	 C1oKhfXVkVri4z46hhMsFKRSyslFQ6+ObTeQZRsIKxLl5MreUQcaBjHHmAeGMptIaHA==
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=fm2 header.b=mId9dV8b;
	dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=DOKZNONi;
	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 C02C2606A336;
	Mon,  9 Nov 2026 20:04:33 +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=fm2 header.b=mId9dV8b;
	dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=DOKZNONi
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.156
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794254672;
	b=rabiAJ8Ee/z7iDDzkZebctwHX1xl/89KGNxrXPcXGdObMFc7izu3nq1amQEPdA/lJmFH
	 LQmYz3o47skP7rw3TtqjXxR933kHCCToavatHvaS7bP2BrHhviZZ89bkIJywOXTvqlTe9
	 SMe0ktPFBLDzb16+Sc3fNp77oLhcPAER8qR2j2Ld5SYdxjWB36crf93haqMoHCA0HiDGZ
	 PmfeRUK81BZaqDIZ9ZXOBOHb54KfeyaspDvufQQMrlX5nhgOqX7DqPml5qYfHAbCT+cLx
	 xTEPrzuIrO14zEJ9+sjfHwv8x3/C/eSZsfmkcRmCwRS6X5UFAxdsQSF7C0yldhMp7mg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794254672;
	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=aXnw9NS0drSD+aXAu6WJUkClj/1AjrNrKLyBKqy+4VY=;
	b=cnShKQNrTLpt2SLXMVkI+8KcEByuxfpB0O77MhWdUDRJN7Z13mR0ZTwqOO2fJOG0Ca+s
	 MrpHM+eb1uf+TNMLsOVfL5xdjAjmVnp7MaVtReOC/wIPvAp0dMe201RLZjOtkWsv3wBRu
	 bf6d3GsnLOJ+fjlM5NN1Z2Q4LKnG1Dk3gR2RgaMyTygG4AfAIW0x80pfAqG8LOernYbFr
	 RXfwBdhlWfRWlVMnq92tdjqPqGHPSQKVWNtK3r2FIWKCSgqvL358MqStpwkPlZXGdwp9J
	 K8ZDInIG5xLRpA06REslUfZN+N15pbGho/v9mAQ5q/fCblrXx+umacw+GzlvW5D2bUg==
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=fm2 header.b=mId9dV8b;
	dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=DOKZNONi;
	arc=none smtp.remote-ip=103.168.172.156
X-Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156])
	(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 841A0606A326
	for <git@vger.kernel.org>; Mon,  9 Nov 2026 20:04:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 841A0606A326
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-11.internal (phl-compute-11.internal [10.202.2.51])
	by mailfhigh.phl.internal (Postfix) with ESMTP id B58B5140012B
	for <git@vger.kernel.org>; Mon,  9 Nov 2026 15:04:31 -0500 (EST)
X-Received: from phl-frontend-02 ([10.202.2.161])
  by phl-compute-11.internal (MEProxy); Mon, 09 Nov 2026 15:04:31 -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=fm2; t=1794254671; x=1794341071; bh=aXnw9NS0dr
	SD+aXAu6WJUkClj/1AjrNrKLyBKqy+4VY=; b=mId9dV8berc7Qm8i2i5oNui59w
	0thSvuCgPAFcpUSSPKtBlwy9gXOJjWtoe7rMGd/cQITrlak3Orh4wxm65ufDuHB0
	VSO2RJcDy/0Lo1afSqJ0U83AQoFKcvVLuBisS0tlEtxGeOv8+Ohp+ikNH9m0Tghf
	gN5jZREEMKLBh6sJqyL3HVWKMeXxigoxF5UG50couNFCictrofxWGy72o0mZ1Q8k
	OLXxwO2v2b+C37PgMabPUx5dG4z276/GzbFIvT8tCps3pwbpSGu/ovl8cwTS0apu
	2VXF3+3r6yh2ZUjKJYkrsGwtjaWFRXgiS5emuzkh6bcCQFPnqG+d06UvAEHg==
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=fm3; t=
	1794254671; x=1794341071; bh=aXnw9NS0drSD+aXAu6WJUkClj/1AjrNrKLy
	BKqy+4VY=; b=DOKZNONilpB0CEJGJ58V4Gs7D7Xjvvd9/T8NvLXF7pEQkTVxrMw
	T9y3XoGxYV+PGEpXe641yca3t3WmaoUIGptXOtqWj+umSXowOBKdece4AHrv1AH+
	VLzaFXbVOwFWIq2iwEa+zYOwpOQDVyS/zldCtEHhUsWU0vcLOA6V0YdvJT1Q6oMA
	YN1KVaGmPBoOlDvm7nkiuaqyMbNUJWyhR5o8upl3BbDE7PlYQanbBw5lg/NQCxmb
	JALiKQEjKcyzf3y6RDBm1Ds1drRiFjH103L+Br5Bmu9Hcn0GtxLX5iHd7+SUTP8T
	MXBRGtp2XcTLHr+YQ/6Nr8UTp1ta0U+doqA==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
	repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
	action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1794254671; d=pobox.com;
	mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
	rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
	s=fm2:rsa-sha256:J4IReZ7pgLjKZiSkOSHgsd9yHUHIox1/0Cf7eqYeEQeRmGN
	T6QMd0lpv/UJRRpG9ilP5AGQQlsxozj+H5e7xJE6+T8w4/Zchr/uMnougB6CG9n4
	srGsIgsBzLZaWgk0y92QmTrT01xkJjfg7VN3OfN30W9dtJlb/uocfP4naLsW8uN4
	rauLX2oBU5x598Ub20k+nhfCUf1AcInUh5/CTj25aaeZgS7m7Ab96bA1TajpfhOh
	TYjSouegxBgkgkiJts5fqJoeZRf1wN064J39YF8NYfZZXJUJmp0TwxPj4FVn6TJT
	6wKLgPDU6DM5PLyTqmyDcMycUijFHkt5xhygotg==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
	repo=github.com/dkim2wg/interop; date=2026-11-03; 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:vMotRowGZdvBu4PsIcx1u//h5LjG7GkXuUVmZ7+w/R8=:xrbVKuRK3mks7o6DBs49Psfzi6S2hZnAsbj/zQnIYFM=;
X-ME-Sender: <xms:TyfyanmGyOKKPihkW9iuSMBKU3yS6QtAUALkbVBjkeWKin2qy9myAQ>
    <xme:Tyfyaug4L5XIkck1DZkDzit0dG7G6Ip0GOlYNo9j2WI9v5E8R2gyJoNxl5ggOSu8s
    rGdzRPec3T2Y-pQsjulFDgBl1Duaxa_trm54HGnw7ti1V-iwCp2cAQ>
X-ME-Received: <xmr:TyfyancF3-DNu84ggmAPx5OxhNZip-hVy9LDi32YH5tJs9aKx41bQKA03QHgl-PhVRp8KWYCtXAqXf7NImHIN2Yxk6OMnA6FT-o->
X-ME-Proxy-Cause: dmFkZTEx63/hQCvTnlpr9E5Ca8pzsh/Y1YNjwocjLOO+n53CWyVjYNJ94yLEyvKMR9SEDR
    z1qn4H8V+Ved8+bN1VCBsAZPkHQ6DtS3abovHQ633DLoXgujLxh4cgta5pdVVArRa8mJWp
    RwqoAhWEUQGh9ML0NlrgZVhegEK4Z35mnmTGSTjEFM01bcV2JKk6IaihnhCLpftzHlKgKg
    5qpdLo4Lj9N/0xaEQYv4QJ2joz++3wKexGx/LTxeYuUmZdNMnDhIacaMKLx2qC0XraV4k4
    rOug+rAQIuy+UbJzpoUBLiIVyGES0qp3/oJoa4uyW/fNk/vnYV11nRkYUNo4RrpF2GkUJr
    rDGEa7jVnrShFQBlgRZ0UaqPAKsDpa+COpDa9CLd5lQBHDu9iBcv2ZvcVlZpYwWkVFrwzB
    irlaqxyRVcVE6lYckEfMPKhFuP1s2/HrB72yIyXq/8OgcpYarDvHARWHKQkt5WOw9s0y0b
    kOxoIPaK4AHLdmI5T49RbyZtwyr/zlWZbIdgHa46uEXZ8ET5EbuONzTRmKSbKMoex+Zk7M
    X5F35Pt2GoCRLG1RNLgy+5uPv4rAaOSjtGEdAVm9Jk/c0QmPC3p/qV4O9fGTS2MQCxkIZL
    57J0OUQR0wxo864fBwKNd+AHc2rNdRiCSss/992fq5xK4u2A3n9e43ZW3Qtg
X-ME-Proxy: <xmx:Tyfyamitfz2WPG3Zv7vvN0VCRkohFFQw0CcCDotIDn7UUyIIzSQ27Q>
    <xmx:TyfyanwUflce9WmWUTwmgEZy5E-RUGgDd2kYEOieUf7LT5rJygeBVg>
    <xmx:TyfyaqM_loD_9TB4G1Dmkrfgm_Fi1x0_CIdLoabzBcRk1OQsBQ5RHw>
    <xmx:TyfyagUBcs_6qQKThfw25wcLQQf5joPPSiaD83iOszRR6ZRFGFT9Sg>
    <xmx:TyfyavhX32dPt50U5abzcqvN4isEo3Ihc-pcbSDvIIKm4Yo_I3D5Vo8a>
X-Feedback-ID: if26b431b:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 9 Nov 2026 15:04:30 -0500 (EST)
X-Cc: Laveesh Bansal <laveeshb@laveeshbansal.com>,  git@vger.kernel.org,
  Karthik Nayak <karthik.188@gmail.com>,  Ævar Arnfjörð Bjarmason
 <avarab@gmail.com>
X-In-Reply-To: <avGU-Wjkd821PLc0@pks.im> (Patrick Steinhardt's message of "Mon,
	9 Nov 2026 10:40:09 +0100")
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