Re: [PATCH] pathspec: rename per-item field has_wildcard to use_wildcard

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

 



On Thu, Apr 7, 2011 at 12:13 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> The extensible syntax I have in mind (we only parse in get_pathspec() in
> such a tentative version but anything other than the :/ will error out) is
> to use:
>
> Â(1) Colon, a run of selected non-alpha (i.e. magic signature), an
> Â Â optional colon to terminate the magic signature, followed by the
> Â Â path, e.g.
>
> Â Â - ":/hello.c" is a path from the top.
>
> Â Â - ":!/hello.c" is path from the top but no globbing.
>
> Â Â - ":/!hello.c" is the same as above.
>
> Â Â - ":/::hello.c" is ":hello.c" from the top, the second colon
> Â Â Â terminates the magic signature and allows the funny file with a
> Â Â Â leading colon to be named.
>
> Â Â - "::hello.c" does not have any magic, is the same as "hello.c".

What about ":hello.c", same as "hello.c"? I think we need to reserve
some more characters for future extension. The selected set of magic
in your patch misses my favourite negate magic :)

By the way, I think we should use a better term than "magic". Pathspec modifier?

> Â(2) Colon, open parenthesis, a comma separated list of words to name
> Â Â magic, close parenthesis, followed by the path, e.g. these are the
> Â Â long-hand counterparts to the examples in (1)
>
> Â Â - ":(top)hello.c"
> Â Â - ":(top,noglob)hello.c"
> Â Â - ":(noglob,top)hello.c"
> Â Â - ":(noglob,top):hello.c"
> Â Â - ":()hello.c"
>

Can we mix short and long magic? It seems impossible in your patch. I
don't know if that's the intention.

> At this point, I am not interested in building the repertoire of magic
> yet, but would want to nail a syntax that is
>
> Â- concise in common cases (e.g. "from the top, not a funny name" is ':/'
> Â followed by the name);
> Â- is extensible in the future; and
> Â- easy to parse and error out on magic we do not understand.
-- 
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]