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

[PATCH 0/6] wildmatch part 2

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Oct 4, 2012, 07:39 UTC
Message-ID
<1349336392-1772-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<7v626q3hen.fsf@alter.siamese.dyndns.org>
On Thu, Oct 4, 2012 at 1:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Perhaps the wildmatch code may not be what we want X-<.

When I imported wildmatch I was hoping to make minimum changes to it. But wildmatch is probably the only practical way to support "**" even if we later need to change it the way we want. Other options are base our work on top of compat/fnmatch.c, which is an #ifdef spaghetti mess, or write a new fnmatch()-compatible function. Both unattractive to me.

Anyway, this is on top of nd/wildmatch, which makes "ab**cd" match full pathname.

attr patches port .gitignore optimizations over. In long term, we should probably have a shared matching implementation instead. I tried that road once and failed so I won't attempt again any time soon. If we drop wildmatch, I can split these attr patches out as a separate series. It's a good thing to do anyway.

The last patch just reflects that current "**" is not exactly what we want. I'm not sure if I could look into wildmatch.c and change it. Anybody is welcome to step up, of course.

Nguyễn Thái Ngọc Duy (6):
  attr: remove the union in struct match_attr
  attr: avoid strlen() on every match
  attr: avoid searching for basename on every match
  attr: more matching optimizations from .gitignore
  gitignore: do not do basename match with patterns that have '**'
  t3001: note about expected "**" behavior
 Documentation/gitignore.txt        |  10 ++--
 attr.c                             | 101 +++++++++++++++++++++++++++----------
 dir.c                              |   6 +--
 dir.h                              |   2 +
 t/t0003-attributes.sh              |  16 ++++++
 t/t3001-ls-files-others-exclude.sh |  18 +++++++
 6 files changed, 118 insertions(+), 35 deletions(-)
-- 
1.7.12.1.405.gb727dc9
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 6 of 28 in “What's cooking in git.git (Oct 2012, #01; Tue, 2)”
  1. Junio C HamanoOct 2, 2012
  2. Nguyen Thai Ngoc DuyOct 3, 2012
  3. Junio C HamanoOct 3, 2012
  4. Nguyen Thai Ngoc DuyOct 4, 2012
  5. Junio C HamanoOct 4, 2012
  6. 0/6 wildmatch part 2Nguyễn Thái Ngọc Duy, Oct 4, 2012
  7. 1/6 attr: remove the union in struct match_attrNguyễn Thái Ngọc Duy, Oct 4, 2012
  8. 2/6 attr: avoid strlen() on every matchNguyễn Thái Ngọc Duy, Oct 4, 2012
  9. 3/6 attr: avoid searching for basename on every matchNguyễn Thái Ngọc Duy, Oct 4, 2012
  10. 4/6 attr: more matching optimizations from .gitignoreNguyễn Thái Ngọc Duy, Oct 4, 2012
  11. 5/6 gitignore: do not do basename match with patterns that have '**'Nguyễn Thái Ngọc Duy, Oct 4, 2012
  12. Junio C HamanoOct 4, 2012
  13. Johannes SixtOct 5, 2012
  14. Nguyen Thai Ngoc DuyOct 5, 2012
  15. 6/6 t3001: note about expected "**" behaviorNguyễn Thái Ngọc Duy, Oct 4, 2012
  16. Junio C HamanoOct 4, 2012
  17. Junio C HamanoOct 4, 2012
  18. Michael HaggertyOct 4, 2012
  19. Nguyen Thai Ngoc DuyOct 4, 2012
  20. Michael HaggertyOct 4, 2012
  21. Junio C HamanoOct 4, 2012
  22. Andreas SchwabOct 5, 2012
  23. Matthieu MoyOct 5, 2012
  24. Andreas SchwabOct 5, 2012
  25. Nguyen Thai Ngoc DuyOct 5, 2012
  26. David Michael BarrOct 4, 2012
  27. Junio C HamanoOct 4, 2012
  28. Florian AchleitnerOct 30, 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.