<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/wildmatch.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-03-20T17:58:53Z</updated>
<entry>
<title>wildmatch: hide internal return values</title>
<updated>2023-03-20T17:58:53Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2023-03-20T16:10:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=91b81b64e332da185d3ac8679a977c665c80914e'/>
<id>urn:sha1:91b81b64e332da185d3ac8679a977c665c80914e</id>
<content type='text'>
WM_ABORT_ALL and WM_ABORT_TO_STARSTAR are used internally to limit
backtracking when a match fails, they are not of interest to the caller
and so should not be public.

Suggested-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode</title>
<updated>2018-10-29T04:19:22Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-10-27T08:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5bbe09e88545cd1a3bcf2b157f020f92e0b5def'/>
<id>urn:sha1:e5bbe09e88545cd1a3bcf2b157f020f92e0b5def</id>
<content type='text'>
In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**'
can but only in three patterns:

- '**/' matches zero or more leading directories
- '/**/' matches zero or more directories in between
- '/**' matches zero or more trailing directories/files

When '**' is present but not in one of these patterns, the current
behavior is consider the pattern invalid and stop matching. In other
words, 'foo**bar' never matches anything, whatever you throw at it.

This behavior is arguably a bit confusing partly because we can't
really tell the user their pattern is invalid so that they can fix
it. So instead, tolerate it and make '**' act like two regular '*'s
(which is essentially the same as a single asterisk). This behavior
seems more predictable.

Noticed-by: dana &lt;dana@dana.is&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: remove unused wildopts parameter</title>
<updated>2017-06-24T01:27:07Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-06-22T21:38:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=55d3426929d4d8c3dec402cabe6fb1bf27d6abad'/>
<id>urn:sha1:55d3426929d4d8c3dec402cabe6fb1bf27d6abad</id>
<content type='text'>
Remove the unused wildopts placeholder struct from being passed to all
wildmatch() invocations, or rather remove all the boilerplate NULL
parameters.

This parameter was added back in commit 9b3497cab9 ("wildmatch: rename
constants and update prototype", 2013-01-01) as a placeholder for
future use. Over 4 years later nothing has made use of it, let's just
remove it. It can be added in the future if we find some reason to
start using such a parameter.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: support "no FNM_PATHNAME" mode</title>
<updated>2013-01-01T23:32:37Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-01-01T02:44:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c41244e702fd4fc1039f39a3915ae1e5f165bbf3'/>
<id>urn:sha1:c41244e702fd4fc1039f39a3915ae1e5f165bbf3</id>
<content type='text'>
So far, wildmatch() has always honoured directory boundary and there
was no way to turn it off. Make it behave more like fnmatch() by
requiring all callers that want the FNM_PATHNAME behaviour to pass
that in the equivalent flag WM_PATHNAME. Callers that do not specify
WM_PATHNAME will get wildcards like ? and * in their patterns matched
against '/', just like not passing FNM_PATHNAME to fnmatch().

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: rename constants and update prototype</title>
<updated>2013-01-01T23:32:36Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-01-01T02:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9b3497cab9986883ff2499722f8758795afa34b7'/>
<id>urn:sha1:9b3497cab9986883ff2499722f8758795afa34b7</id>
<content type='text'>
- All exported constants now have a prefix WM_
- Do not rely on FNM_* constants, use the WM_ counterparts
- Remove TRUE and FALSE to follow Git's coding style
- While at it, turn flags type from int to unsigned int
- Add an (unused yet) argument to carry extra information
  so that we don't have to change the prototype again later
  when we need to pass other stuff to wildmatch

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: adjust "**" behavior</title>
<updated>2012-10-15T21:58:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-15T06:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40bbee0ab07d0ee4f21b11d597c878245c1b05a6'/>
<id>urn:sha1:40bbee0ab07d0ee4f21b11d597c878245c1b05a6</id>
<content type='text'>
Standard wildmatch() sees consecutive asterisks as "*" that can also
match slashes. But that may be hard to explain to users as
"abc/**/def" can match "abcdef", "abcxyzdef", "abc/def", "abc/x/def",
"abc/x/y/def"...

This patch changes wildmatch so that users can do

- "**/def" -&gt; all paths ending with file/directory 'def'
- "abc/**" - equivalent to "/abc/"
- "abc/**/def" -&gt; "abc/x/def", "abc/x/y/def"...
- otherwise consider the pattern malformed if "**" is found

Basically the magic of "**" only remains if it's wrapped around by
slashes.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: remove static variable force_lower_case</title>
<updated>2012-10-15T21:58:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-15T06:25:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9b4edc0a49abd4b5c6505c63c8fa40d527df6ae8'/>
<id>urn:sha1:9b4edc0a49abd4b5c6505c63c8fa40d527df6ae8</id>
<content type='text'>
One place less to worry about thread safety. Also combine wildmatch
and iwildmatch into one.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wildmatch: remove unnecessary functions</title>
<updated>2012-10-15T21:58:17Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-15T06:25:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0e0287626d6257dd45df5502a07efd15a7255bc'/>
<id>urn:sha1:b0e0287626d6257dd45df5502a07efd15a7255bc</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Import wildmatch from rsync</title>
<updated>2012-10-15T21:58:17Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-15T06:25:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5230f605e1afd4e3824aae069a5f1bead6f1647f'/>
<id>urn:sha1:5230f605e1afd4e3824aae069a5f1bead6f1647f</id>
<content type='text'>
These files are from rsync.git commit
f92f5b166e3019db42bc7fe1aa2f1a9178cd215d, which was the last commit
before rsync turned GPL-3. All files are imported as-is and
no-op. Adaptation is done in a separate patch.

rsync.git           -&gt;  git.git
lib/wildmatch.[ch]      wildmatch.[ch]
wildtest.txt            t/t3070/wildtest.txt

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
