From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Jan Klötzke" <jan@kloetzke.net>,
git@vger.kernel.org, "Steve Kemp" <steve@steve.org.uk>,
"René Scharfe" <l.s.r@web.de>,
"Stefan Beller" <stefanbeller@gmail.com>
Subject: Re: [PATCH] ref-filter: handle nested tags in --points-at option
Date: Wed, 05 Jul 2023 10:16:17 -0700 [thread overview]
Message-ID: <xmqqedlm2s9q.fsf@gitster.g> (raw)
In-Reply-To: <20230705124107.GA3932508@coredump.intra.peff.net> (Jeff King's message of "Wed, 5 Jul 2023 08:41:07 -0400")
Jeff King <peff@peff.net> 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.
next prev parent reply other threads:[~2023-07-05 17:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-01 20:57 [PATCH] ref-filter: handle nested tags in --points-at option Jan Klötzke
2023-07-02 12:56 ` Jeff King
2023-07-02 16:25 ` René Scharfe
2023-07-02 20:27 ` Jeff King
2023-07-02 22:02 ` Jeff King
2023-07-02 22:33 ` [PATCH 0/3] a few --points-at optimizations/cleanups Jeff King
2023-07-02 22:35 ` [PATCH 1/3] ref-filter: avoid parsing tagged objects in match_points_at() Jeff King
2023-07-02 22:37 ` [PATCH 2/3] ref-filter: avoid parsing non-tags " Jeff King
2023-07-02 22:38 ` [PATCH 3/3] ref-filter: simplify return type of match_points_at Jeff King
2023-07-03 20:25 ` [PATCH] ref-filter: handle nested tags in --points-at option Jan Klötzke
2023-07-05 6:10 ` Junio C Hamano
2023-07-05 12:41 ` Jeff King
2023-07-05 17:16 ` Junio C Hamano [this message]
2023-07-05 18:50 ` Jan Klötzke
2023-07-05 20:15 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqedlm2s9q.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jan@kloetzke.net \
--cc=l.s.r@web.de \
--cc=peff@peff.net \
--cc=stefanbeller@gmail.com \
--cc=steve@steve.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).