Re: [WIP PATCH 0/5] support --exclude for diff/log commands

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

 



On Thu, Mar 10, 2011 at 5:05 PM, Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> wrote:
> 2011/3/10 Junio C Hamano <gitster@xxxxxxxxx>:
>> Let's step back a bit.
>>
>> We chose to use ":/<regexp>" as one new form of extended SHA-1 expression
>> to name an object for two reasons: (1) no normal <ref> can have a colon in
>> it, because of check-ref-format restriction; (2) ":" is an unlikely letter
>> to appear at the beginning of a pathname, and people with such a path can
>> work around by saying "./:frotz" or "\:xyzzy".
>>
>> There is a disambiguation logic to check a list of arguments that lacks an
>> explicit "--" separator to make sure that each element early on the list
>> can only be interpreted as an object name but not as a pathname that
>> exists on the filesystem, and all the remaining elements are pathnames
>> that exist on the filesystem.
>>
>> If we introduce an extended syntax for pathspec and make the prefix magic
>> character ":", and if we choose to use ":/" as one kind of magic, I was a
>> bit worried that this may affect the disambiguation. ÂThe users must use
>> an explicit "--" when feeding a pathspec with the magic so that the parser
>> knows which kind of magic (either object name magic or pathspec magic)
>> they are talking about.
>
> Or.. we can consider this ':' a special form of wildcard and interpret
> the same way:
>
> Â- first try exact match. If it matches, the leading ':' is
> interpreted literally as part of file name.
> Â- magic.

One thing that makes it different from Michael's approach is, :/foo
will match ':/foo' literally in every directories and foo at top-tree.
I feel mildly uncomfortable with it, but it makes it consistent with
other wildcards. If no one objects, I'll try to make a patch with this
approach.
-- 
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]