Re: [PATCH 2/5] pathspec: add tree_recursive_diff parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/9/28 Junio C Hamano <gitster@xxxxxxxxx>:
> Nguyán ThÃi Ngác Duy Â<pclouds@xxxxxxxxx> writes:
>
>> When wildcard match is implemented, a full path is needed to do final
>> match. What type of diff_tree is performed determines how to treat
>> directories:
>>
>> Â- If it's recursive diff, directories are just an intermediate step.
>> Â ÂAll path must end with a file name. Thus, directories will be
>> Â Âunconditionally matched.
>
> Hmm, I am not sure what you mean by this. ÂIf the pathspec says a/b*/c,
> you are in "a" and are deciding if you should descend to its subdirectory,
> then you would surely want to be able to say:
>
> Â(1) Ah, the subdirectory I am looking at is "bar" and it does match "b*".
> Â Â It might contain "c"; I should descend into it.
>
> Â(2) Nope, the subdirectory I am looking at is "frotz" and it can never
> Â Â match "b*", so there is no point recursing into it.
>

I did not go that far, trying to analyse the pattern. When I wrote
"immediate step" I was thinking of "*foo" pattern, which effectively
means descending to any reachable directories because '*' matches
slashes too. I think that's the worst case.

Anyway I did not know that I could borrow some optimizations from
pathspec_matches() in builtin/grep.c.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]