<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pathspec.h, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-13T22:28:54Z</updated>
<entry>
<title>pathspec: allow querying for attributes</title>
<updated>2017-03-13T22:28:54Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-13T18:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0db70465246bb8309d3d12c9bc34ac3f0c1e203'/>
<id>urn:sha1:b0db70465246bb8309d3d12c9bc34ac3f0c1e203</id>
<content type='text'>
The pathspec mechanism is extended via the new
":(attr:eol=input)pattern/to/match" syntax to filter paths so that it
requires paths to not just match the given pattern but also have the
specified attrs attached for them to be chosen.

Based on a patch by Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: copy and free owned memory</title>
<updated>2017-01-09T02:04:17Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-04T18:04:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8aee769fa12ff0d3a4100c3d0359bc33e49db672'/>
<id>urn:sha1:8aee769fa12ff0d3a4100c3d0359bc33e49db672</id>
<content type='text'>
The 'original' string entry in a pathspec_item is only duplicated some
of the time, instead always make a copy of the original and take
ownership of the memory.

Since both 'match' and 'original' string entries in a pathspec_item are
owned by the pathspec struct, they need to be freed when clearing the
pathspec struct (in 'clear_pathspec()') and duplicated when copying the
pathspec struct (in 'copy_pathspec()').

Also change the type of 'match' and 'original' to 'char *' in order to
more explicitly show the ownership of the memory.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Reviewed-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>pathspec: remove the deprecated get_pathspec function</title>
<updated>2017-01-09T02:04:17Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-04T18:04:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34305f7753f9f044cb280e6d58658cb31b140693'/>
<id>urn:sha1:34305f7753f9f044cb280e6d58658cb31b140693</id>
<content type='text'>
Now that all callers of the old 'get_pathspec' interface have been
migrated to use the new pathspec struct interface it can be removed
from the codebase.

Since there are no more users of the '_raw' field in the pathspec struct
it can also be removed.  This patch also removes the old functionality
of modifying the const char **argv array that was passed into
parse_pathspec.  Instead the constructed 'match' string (which is a
pathspec element with the prefix prepended) is only stored in its
corresponding pathspec_item entry.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Reviewed-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>Merge branch 'bw/pathspec-remove-unused-extern-decl'</title>
<updated>2016-09-21T22:15:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-21T22:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=570b4494c7c331bf77ce3a11122993a656901f4a'/>
<id>urn:sha1:570b4494c7c331bf77ce3a11122993a656901f4a</id>
<content type='text'>
Code cleanup.

* bw/pathspec-remove-unused-extern-decl:
  pathspec: remove unnecessary function prototypes
</content>
</entry>
<entry>
<title>pathspec: remove unnecessary function prototypes</title>
<updated>2016-09-13T23:10:03Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2016-09-13T16:52:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e78d57ec8e330ab59058f932c0ba211014f4f6be'/>
<id>urn:sha1:e78d57ec8e330ab59058f932c0ba211014f4f6be</id>
<content type='text'>
A few functions were removed in 5a76aff1 ("add: convert to use
parse_pathspec", 2013-07-14), but we forgot to remove their external
declarations from pathspec.h while doing so.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: rename free_pathspec() to clear_pathspec()</title>
<updated>2016-06-02T21:09:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-06-02T21:09:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed6e8038f98e7f15e571a9a291ee4acf438b4dc5'/>
<id>urn:sha1:ed6e8038f98e7f15e571a9a291ee4acf438b4dc5</id>
<content type='text'>
The function takes a pointer to a pathspec structure, and releases
the resources held by it, but does not free() the structure itself.
Such a function should be called "clear", not "free".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Support pathspec magic :(exclude) and its short form :!</title>
<updated>2013-12-06T21:00:39Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-12-06T07:30:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef79b1f8704668a6cdf4278f9255e03ca785bfb4'/>
<id>urn:sha1:ef79b1f8704668a6cdf4278f9255e03ca785bfb4</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>pathspec: stop --*-pathspecs impact on internal parse_pathspec() uses</title>
<updated>2013-10-28T16:57:36Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-10-26T02:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a2d5ae262a6d372d0951da9cee3c7ad2a8dbca6'/>
<id>urn:sha1:4a2d5ae262a6d372d0951da9cee3c7ad2a8dbca6</id>
<content type='text'>
Normally parse_pathspec() is used on command line arguments where it
can do fancy thing like parsing magic on each argument or adding magic
for all pathspecs based on --*-pathspecs options.

There's another use of parse_pathspec(), where pathspec is needed, but
the input is known to be pure paths. In this case we usually don't
want --*-pathspecs to interfere. And we definitely do not want to
parse magic in these paths, regardless of --literal-pathspecs.

Add new flag PATHSPEC_LITERAL_PATH for this purpose. When it's set,
--*-pathspecs are ignored, no magic is parsed. And if the caller
allows PATHSPEC_LITERAL (i.e. the next calls can take literal magic),
then PATHSPEC_LITERAL will be set.

This fixes cases where git chokes when GIT_*_PATHSPECS are set because
parse_pathspec() indicates it won't take any magic. But
GIT_*_PATHSPECS add them anyway. These are

   export GIT_LITERAL_PATHSPECS=1
   git blame -- something
   git log --follow something
   git log --merge

"git ls-files --with-tree=path" (aka parse_pathspec() in
overlay_tree_on_cache()) is safe because the input is empty, and
producing one pathspec due to PATHSPEC_PREFER_CWD does not take any
magic into account.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/magic-pathspec'</title>
<updated>2013-09-09T21:50:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-09T21:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fadf96abaa5f42c4bb7b4b5017926779c23d8ef3'/>
<id>urn:sha1:fadf96abaa5f42c4bb7b4b5017926779c23d8ef3</id>
<content type='text'>
Use "struct pathspec" interface in more places, instead of array of
characters, the latter of which cannot express magic pathspecs
(e.g. ":(icase)makefile" that matches both Makefile and makefile).

* nd/magic-pathspec:
  add: lift the pathspec magic restriction on "add -p"
  pathspec: catch prepending :(prefix) on pathspec with short magic
</content>
</entry>
<entry>
<title>parse_pathspec: accept :(icase)path syntax</title>
<updated>2013-07-15T19:14:38Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93d935371654faf2956a4c37c1ca46f3195ee832'/>
<id>urn:sha1:93d935371654faf2956a4c37c1ca46f3195ee832</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>
</feed>
