From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 0/8] wildmatch take 3
Date: Tue, 9 Oct 2012 10:08:59 +0700 [thread overview]
Message-ID: <1349752147-13314-1-git-send-email-pclouds@gmail.com> (raw)
Still experimental but the semantics is getting better, I think.
Please point out what you think still does not make sense. Quote from
the last patch:
Two consecutive asterisks ("`**`") in patterns matched against
full pathname may have special meaning:
- A leading "`**`" followed by a slash means match in all
directories. For example, "`**/foo`" matches file or directory
"`foo`" anywhere, the same as pattern "`foo`". "**/foo/bar"
matches file or directory "`bar`" anywhere that is directly
under directory "`foo`".
- A trailing "/**" matches everything inside. For example,
"abc/**" is equivalent to "`/abc/`".
- A slash followed by two consecutive asterisks then a slash
matches zero or more directories. For example, "`a/**/b`"
matches "`a/b`", "`a/x/b`", "`a/x/y/b`" and so on.
- Consecutive asterisks otherwise are treated like normal
asterisk wildcards.
"abc/**" and "abc/*" are different in attr (the former matches all
files, the latter only files directly under abc) while they are the
same for ignore. I don't like these subtleties but I don't
think we have a choice unless we rework attr matching machinery.
Tests t3070.100 and .101 fail on some machine and not on other due to
(I guess) fnmatch behavior changes. Maybe we should fallback on
compat/fnmatch in such cases for consistent behavior.
There are problems with asciidoc and "`**/`" but that's not something
we need to care now.
On top of master (and a small conflict with nd/attr-match-optim-more)
Nguyễn Thái Ngọc Duy (8):
Import wildmatch from rsync
wildmatch: remove unnecessary functions
Integrate wildmatch to git
wildmatch: remove static variable force_lower_case
wildmatch: fix case-insensitive matching
wildmatch: adjust "**" behavior
wildmatch: make /**/ match zero or more directories
Support "**" wildcard in .gitignore and .gitattributes
.gitignore | 1 +
Documentation/gitignore.txt | 19 +++
Makefile | 3 +
attr.c | 4 +-
dir.c | 4 +-
t/t0003-attributes.sh | 38 ++++++
t/t3001-ls-files-others-exclude.sh | 19 +++
t/t3070-wildmatch.sh | 184 ++++++++++++++++++++++++++++
test-wildmatch.c | 14 +++
wildmatch.c | 245 +++++++++++++++++++++++++++++++++++++
wildmatch.h | 3 +
11 files changed, 532 insertions(+), 2 deletions(-)
create mode 100755 t/t3070-wildmatch.sh
create mode 100644 test-wildmatch.c
create mode 100644 wildmatch.c
create mode 100644 wildmatch.h
--
1.8.0.rc0.29.g1fdd78f
next reply other threads:[~2012-10-09 3:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-09 3:08 Nguyễn Thái Ngọc Duy [this message]
2012-10-09 3:09 ` [PATCH 1/8] Import wildmatch from rsync Nguyễn Thái Ngọc Duy
2012-10-09 3:09 ` [PATCH 2/8] wildmatch: remove unnecessary functions Nguyễn Thái Ngọc Duy
2012-10-09 3:09 ` [PATCH 3/8] Integrate wildmatch to git Nguyễn Thái Ngọc Duy
2012-10-09 3:09 ` [PATCH 4/8] wildmatch: remove static variable force_lower_case Nguyễn Thái Ngọc Duy
2012-10-09 20:47 ` Junio C Hamano
2012-10-10 5:14 ` Nguyen Thai Ngoc Duy
2012-10-10 5:31 ` Junio C Hamano
2012-10-10 5:47 ` Nguyen Thai Ngoc Duy
2012-10-09 3:09 ` [PATCH 5/8] wildmatch: fix case-insensitive matching Nguyễn Thái Ngọc Duy
2012-10-09 3:09 ` [PATCH 6/8] wildmatch: adjust "**" behavior Nguyễn Thái Ngọc Duy
2012-10-09 3:09 ` [PATCH 7/8] wildmatch: make /**/ match zero or more directories Nguyễn Thái Ngọc Duy
2012-10-09 3:09 ` [PATCH 8/8] Support "**" wildcard in .gitignore and .gitattributes Nguyễn Thái Ngọc Duy
2012-10-09 7:57 ` Michael Haggerty
2012-10-10 5:40 ` Nguyen Thai Ngoc Duy
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=1349752147-13314-1-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
/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).