From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA157EB64DA for ; Wed, 5 Jul 2023 17:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232241AbjGERQW (ORCPT ); Wed, 5 Jul 2023 13:16:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjGERQV (ORCPT ); Wed, 5 Jul 2023 13:16:21 -0400 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4731D173F for ; Wed, 5 Jul 2023 10:16:20 -0700 (PDT) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 76110188B8A; Wed, 5 Jul 2023 13:16:19 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=8tB3+w7RTCW2olqO+DBEgBPWAUnuWabmW95NC3 3oaAQ=; b=RNCqCxodW7vC1M3LmjpMyRrKvY5xoRovCn4/pJfF020pUdEDMGmS8b 6+cmAAM0k8ICR0Cffn3IGreo+Y/zeJUWR1YR7dKoY0jaJcsZtTY5V9yCMjWLADwt hWVk/AlGe6Rpx2SGQG1mdW4+PRBRfAFelt6L5CIYCiOoiRBWPEI/M= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 6F900188B88; Wed, 5 Jul 2023 13:16:19 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.233.135.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id D6F61188B87; Wed, 5 Jul 2023 13:16:18 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Jan =?utf-8?Q?Kl=C3=B6tzke?= , git@vger.kernel.org, Steve Kemp , =?utf-8?Q?Ren=C3=A9?= Scharfe , Stefan Beller Subject: Re: [PATCH] ref-filter: handle nested tags in --points-at option References: <20230701205703.1172505-1-jan@kloetzke.net> <20230702125611.GA1036686@coredump.intra.peff.net> <20230705124107.GA3932508@coredump.intra.peff.net> Date: Wed, 05 Jul 2023 10:16:17 -0700 In-Reply-To: <20230705124107.GA3932508@coredump.intra.peff.net> (Jeff King's message of "Wed, 5 Jul 2023 08:41:07 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: A7F3D73E-1B57-11EE-B1A5-C65BE52EC81B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > On Tue, Jul 04, 2023 at 11:10:47PM -0700, Junio C Hamano wrote: > >> My preference would be to see these optimization done first and then >> add this new loop on top of it. That way, we can measure more >> easily what kind of additional overhead, if any, we are paying by >> adding the loop. > > I ended up doing them on top, rather than before, but I think the size > of the impact can easily be seen. Ah, I should have first read (or at least skimmed) all messages before responding. Thanks for following through. > The one thing that would actually make us a lot faster (by using the > packed-refs peels) is to make full peels the only option, and do not > bother letting --points-at match "B" in an A->B->C peel. But that would > be removing something that is currently matched (even before the patch > in this thread), so I stopped short of it in my optimizations. Interesting. Right now, if I create a 'direct' tag that points directly at HEAD, and then create an 'indirect' tag that points at 'direct', i.e. $ git tag -a -m 'a direct tag to HEAD' direct HEAD $ git tag -a -m 'an indirect tag' indirect direct I would get a piece of advice message that encourages to correct the mistake with "git tag -f indirect direct^{}". Then I ask for tags that point at HEAD, I see only 'direct' and not 'indirect'. Your optimization would start showing both 'direct' and 'indirect' if they are packed. But you are correct to worry about the opposite case. If I ask for tags that point at 'direct', I currently see 'indirect', but of course 'indirect' will not appear as the peeled value of any ref, and the optimized version will stop saying that 'indirect' is a ref that points at 'direct'. That sounds like a regression. > But even > if we decide to do that, Jan's patch is not making anything worse there > (in fact, it is making it better, because it is matching "C" which we do > not currently match). > ... > So I'd be inclined to proceed with the patches I sent earlier, and then > if we choose to later refactor again to drop "B", we can. We generally avoid taking away anything once we give it to users; once the patch under discussion goes in, there is no taking it back, i.e. the new _behaviour_ closes the door to certain optimizations. I do not at all mind to see us decide and declare that it is a good thing to say that not just 'direct' but also 'indirect' points at HEAD, and that 'indirect' points at 'direct' and the patch under discussion makes the world a etter place, and we will not regret that decision. But the time to make such a decision is now, before we give a go-ahead to the patch. Thanks.