Re: Expected behaviour for pathspecs matching attributes in subdirectories
- From
Matthew Hughes <matthewhughes934@gmail.com>
- Date
- Jul 8, 2023, 12:42 UTC
- Message-ID
- <20230708124253.6g2sl2diipqfma7g@archP14s>
- In-Reply-To
- <xmqq1qhjbpoz.fsf@gitster.g>
On Fri, Jul 07, 2023 at 10:23:56AM -0700, Junio C Hamano wrote:
> I think in this case the common prefix optimization in "ls-files.c" > is broken. If we disable it like the attached illustration patch, > we will see that pathspecs that end with "sub" or "sub/" behave the > same way, which is what I think people would expect.
Thanks, this also revealed a temporary workaround for me, just add a pathspec that ensures there's no common prefix but also matches nothing:
$ git ls-files -- ':(attr:labelA)sub/sub/' 'not/a/real/path'
sub/sub/fileAI might have a look into that optimization and see what changes might be made, but given I am unfamiliar with the code-base this might not be the most productive search.