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

[PATCH/RFC 0/3] Support ignore rule "**" using wildmatch from rsync

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
May 7, 2012, 13:01 UTC
Message-ID
<1336395717-7799-1-git-send-email-pclouds@gmail.com>

I've been looking for something like this. Bash 4 has a similar feature, but it's GPL-3. rsync is also GPL-3. Luckily this feature was availble before the license change.

I'm not sure if we should import wildmatch just to support "**". It seems a nice and often requested feature. And the code looks more readable than compat/fnmatch, which is good since I don't think we can cherry pick from (gpl3) upstream.

We would need to add case folding support or convert "abc" to "[aA][bB][cC]". Performance vs fnmatch is another question but we could switch to wildmatch only in the presence of "**" if wildmatch perf sucks. Even pathspec may make use of this, thanks to pathspec magic.

I have not looked carefully at it and this series is more like a proof of concept than a candidate for 'pu'. Any comments in favor or oppose this?

Nguyễn Thái Ngọc Duy (3):
  Import wildmatch from rsync
  Integrate wildmatch to git
  gitignore: support "**" with wildmatch()
 Makefile                       |    3 +
 compat/wildmatch.c             |  356 ++++++++++++++++++++++++++++++++++++++++
 compat/wildmatch.h             |    6 +
 dir.c                          |   20 ++-
 dir.h                          |    1 +
 t/t3070-wildmatch.sh           |   27 +++
 t/t3070-wildmatch/wildtest.txt |  165 +++++++++++++++++++
 test-wildmatch.c               |  162 ++++++++++++++++++
 8 files changed, 736 insertions(+), 4 deletions(-)
 create mode 100644 compat/wildmatch.c
 create mode 100644 compat/wildmatch.h
 create mode 100755 t/t3070-wildmatch.sh
 create mode 100644 t/t3070-wildmatch/wildtest.txt
 create mode 100644 test-wildmatch.c
-- 
1.7.8.36.g69ee2
Next: Nguyễn Thái Ngọc Duy
Message 1 of 5 in “Support ignore rule "**" using wildmatch from rsync”
  1. 0/3 Support ignore rule "**" using wildmatch from rsyncNguyễn Thái Ngọc Duy, May 7, 2012
  2. 1/3 Import wildmatch from rsyncNguyễn Thái Ngọc Duy, May 7, 2012
  3. 2/3 Integrate wildmatch to gitNguyễn Thái Ngọc Duy, May 7, 2012
  4. 3/3 gitignore: support "**" with wildmatch()Nguyễn Thái Ngọc Duy, May 7, 2012
  5. Junio C HamanoMay 7, 2012

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.