git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Apr 7, 2011, 12:51 UTC
Message-ID
<BANLkTi=sjhWdav6QLguUnr6HE3Roc0NM4Q@mail.gmail.com>
In-Reply-To
<7vfwpvjobl.fsf@alter.siamese.dyndns.org>
On Thu, Apr 7, 2011 at 12:13 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> 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?
Show 10 quoted lines
>  (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.

Show 7 quoted lines
> 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
Previous: Junio C Hamano
Message 11 of 11 in “pathspec: rename per-item field has_wildcard to use_wildcard”
  1. pathspec: rename per-item field has_wildcard to use_wildcardJunio C Hamano, Apr 5, 2011
  2. Nguyen Thai Ngoc DuyApr 6, 2011
  3. Junio C HamanoApr 6, 2011
  4. Junio C HamanoApr 6, 2011
  5. Michael J GruberApr 7, 2011
  6. Nguyen Thai Ngoc DuyApr 7, 2011
  7. Junio C HamanoApr 7, 2011
  8. Junio C HamanoApr 7, 2011
  9. Michael J GruberApr 8, 2011
  10. Junio C HamanoApr 8, 2011
  11. Nguyen Thai Ngoc DuyApr 7, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.