git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG?] read_directory(), core.ignorecase and pathspec
@ 2011-05-12 13:24 Nguyen Thai Ngoc Duy
  2011-05-12 16:04 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2011-05-12 13:24 UTC (permalink / raw)
  To: Git Mailing List

I was looking at how read_directory() uses pathspec, and it seems that
simplify_away(), the function that cuts out directories early if
they're definitely outside given pathspec, does exact match (ie.
memcmp) regardless core.ignorecase. This means "git add -- '*.c'" may
not work as expected when core.ignorecase is on.

I haven't tested it though. Just heads up. If you care about
core.ignorecase (I don't apparently), you can try it out.

The whole simplifying thing in read_directory() will eventually be
replaced with real pathspec matching as we put more magic in pathspec.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG?] read_directory(), core.ignorecase and pathspec
  2011-05-12 13:24 [BUG?] read_directory(), core.ignorecase and pathspec Nguyen Thai Ngoc Duy
@ 2011-05-12 16:04 ` Junio C Hamano
  2011-05-13  0:39   ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2011-05-12 16:04 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> I was looking at how read_directory() uses pathspec, and it seems that
> simplify_away(), the function that cuts out directories early if
> they're definitely outside given pathspec, does exact match (ie.
> memcmp) regardless core.ignorecase. This means "git add -- '*.c'" may
> not work as expected when core.ignorecase is on.

I don't think for '*.c' it would make any difference, but it is very
plausible that 'frotz/*.c' will cull 'Frotz/anything' as "never going to
match".

> The whole simplifying thing in read_directory() will eventually be
> replaced with real pathspec matching as we put more magic in pathspec.

That should be done not "as" but "before". Get the foundation right before
going fancier.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG?] read_directory(), core.ignorecase and pathspec
  2011-05-12 16:04 ` Junio C Hamano
@ 2011-05-13  0:39   ` Nguyen Thai Ngoc Duy
  0 siblings, 0 replies; 3+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2011-05-13  0:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Thu, May 12, 2011 at 11:04 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> I was looking at how read_directory() uses pathspec, and it seems that
>> simplify_away(), the function that cuts out directories early if
>> they're definitely outside given pathspec, does exact match (ie.
>> memcmp) regardless core.ignorecase. This means "git add -- '*.c'" may
>> not work as expected when core.ignorecase is on.
>
> I don't think for '*.c' it would make any difference, but it is very
> plausible that 'frotz/*.c' will cull 'Frotz/anything' as "never going to
> match".

Right, it only checks prefix.

>> The whole simplifying thing in read_directory() will eventually be
>> replaced with real pathspec matching as we put more magic in pathspec.
>
> That should be done not "as" but "before". Get the foundation right before
> going fancier.
>

Right, again.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-13  0:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12 13:24 [BUG?] read_directory(), core.ignorecase and pathspec Nguyen Thai Ngoc Duy
2011-05-12 16:04 ` Junio C Hamano
2011-05-13  0:39   ` Nguyen Thai Ngoc Duy

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).