From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Michael J Gruber <git@drmicha.warpmail.net>
Subject: Re: [PATCH] pathspec: rename per-item field has_wildcard to use_wildcard
Date: Thu, 7 Apr 2011 19:51:34 +0700 [thread overview]
Message-ID: <BANLkTi=sjhWdav6QLguUnr6HE3Roc0NM4Q@mail.gmail.com> (raw)
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:
> 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
prev parent reply other threads:[~2011-04-07 12:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 22:10 [PATCH] pathspec: rename per-item field has_wildcard to use_wildcard Junio C Hamano
2011-04-06 15:54 ` Nguyen Thai Ngoc Duy
2011-04-06 17:13 ` Junio C Hamano
2011-04-06 19:52 ` Junio C Hamano
2011-04-07 11:09 ` Michael J Gruber
2011-04-07 13:00 ` Nguyen Thai Ngoc Duy
2011-04-07 19:44 ` Junio C Hamano
2011-04-07 19:47 ` Junio C Hamano
2011-04-08 8:29 ` Michael J Gruber
2011-04-08 19:40 ` Junio C Hamano
2011-04-07 12:51 ` Nguyen Thai Ngoc Duy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTi=sjhWdav6QLguUnr6HE3Roc0NM4Q@mail.gmail.com' \
--to=pclouds@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).