Subject: Re: [PATCH v3 2/2] completion: fix bugs with slashes in remote names

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 Mar 2025 16:23:26 -0700

David Mandelberg <[email-masked]> writes:

> Op 2025-03-14 om 18:18 schreef Junio C Hamano:
>> David Mandelberg <[email-masked]> writes:
>> 
>>> +	__git for-each-ref --format='%(refname)' 'refs/remotes/**' |
>> Just a bit of curiosity, but how would this be different from using
>> 	__git for-each-ref --format='%(refname)' refs/remotes/
>> i.e. the prefix match, here?  Does the wildmatcher clever enough to
>> optimize "**" away and make it just to iterate over refs/remotes/
>> hierarchy without filtering anything?
>
> Oh right, I lost track of that bit. When I wrote that, I didn't know
> that for-each-ref did prefix matching. Phillip Wood pointed it out:
>
>> If there are no glob characters then "git for-each-ref" does a prefix match so strictly speaking you don't need the '**' but I don't think it matters in practice.
>
> But I forgot about it when I sent v3.
>
> Do you want me to change it? Should I send a v4 now, or just make a
> fixup commit locally so I don't forget it when I send a v4 in the
> future?

Entirely up to you.  I do not plan to perform an in-detail review on
the topic (I do not consider myself quite qualified), but others who
saw earlier rounds of the patch may want to say "now this is perfect"
or "now this is perfect with this and that changes", and if you do not
think the differenes between v3 and your upcoming v4 are small enough,
it may be more efficient to wait for a bit to collect more comments.

Thanks.