<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pathspec.h, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-12-19T19:33:56Z</updated>
<entry>
<title>Merge branch 'bw/pathspec-match-submodule-boundary'</title>
<updated>2017-12-19T19:33:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-12-19T19:33:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4f233e13daa584e5178141eb10e6e9527a3454c'/>
<id>urn:sha1:f4f233e13daa584e5178141eb10e6e9527a3454c</id>
<content type='text'>
An v2.12-era regression in pathspec match logic, which made it look
into submodule tree even when it is not desired, has been fixed.

* bw/pathspec-match-submodule-boundary:
  pathspec: only match across submodule boundaries when requested
</content>
</entry>
<entry>
<title>pathspec: only match across submodule boundaries when requested</title>
<updated>2017-12-05T17:23:15Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-12-05T00:07:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eef3df5a93784e4d709907ce03006374ffc3ea26'/>
<id>urn:sha1:eef3df5a93784e4d709907ce03006374ffc3ea26</id>
<content type='text'>
Commit 74ed43711fd (grep: enable recurse-submodules to work on &lt;tree&gt;
objects, 2016-12-16) taught 'tree_entry_interesting()' to be able to
match across submodule boundaries in the presence of wildcards.  This is
done by performing literal matching up to the first wildcard and then
punting to the submodule itself to perform more accurate pattern
matching.  Instead of introducing a new flag to request this behavior,
commit 74ed43711fd overloaded the already existing 'recursive' flag in
'struct pathspec' to request this behavior.

This leads to a bug where whenever any other caller has the 'recursive'
flag set as well as a pathspec with wildcards that all submodules will
be indicated as matches.  One simple example of this is:

	git init repo
	cd repo

	git init submodule
	git -C submodule commit -m initial --allow-empty

	touch "[bracket]"
	git add "[bracket]"
	git commit -m bracket
	git add submodule
	git commit -m submodule

	git rev-list HEAD -- "[bracket]"

Fix this by introducing the new flag 'recurse_submodules' in 'struct
pathspec' and using this flag to determine if matches should be allowed
to cross submodule boundaries.

This fixes https://github.com/git-for-windows/git/issues/1371.

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 doc: parse_pathspec does not maintain references to args</title>
<updated>2017-09-21T05:05:00Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2017-09-21T04:41:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=29c0e902a803d8865b9421edadf2ca7c565e355c'/>
<id>urn:sha1:29c0e902a803d8865b9421edadf2ca7c565e355c</id>
<content type='text'>
The command line arguments passed to main() are valid for the life of
a program, but the same is not true for all other argv-style arrays
(e.g.  when a caller creates an argv_array).  Clarify that
parse_pathspec does not rely on the argv passed to it to remain valid.

This makes it easier to tell that callers like "git rev-list --stdin"
are safe and ensures that that is more likely to remain true as the
implementation of parse_pathspec evolves.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: convert find_pathspecs_matching_against_index to take an index</title>
<updated>2017-05-12T05:23:46Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-11T22:04:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08de9151a8a67f29a3a5a36931298237d78ca736'/>
<id>urn:sha1:08de9151a8a67f29a3a5a36931298237d78ca736</id>
<content type='text'>
Convert find_pathspecs_matching_against_index to take an index
parameter.

In addition mark pathspec.c with NO_THE_INDEX_COMPATIBILITY_MACROS now
that it doesn't use any cache macros or reference 'the_index'.

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: remove PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP</title>
<updated>2017-05-12T05:23:46Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-11T22:04:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2249d4dbc197d45da5407cbc80b2461e49bb8785'/>
<id>urn:sha1:2249d4dbc197d45da5407cbc80b2461e49bb8785</id>
<content type='text'>
Since (ae8d08242 pathspec: pass directory indicator to
match_pathspec_item()) the path matching logic has been able to cope
with submodules without needing to strip off a trailing slash if a path
refers to a submodule.

Since stripping the slash is no longer necessary, remove the
PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP flag.

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: remove PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flag</title>
<updated>2017-05-12T05:23:46Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-11T22:04:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c08397e3aa46fd0f0da29dfe5b257839b9c5d1c8'/>
<id>urn:sha1:c08397e3aa46fd0f0da29dfe5b257839b9c5d1c8</id>
<content type='text'>
Since (ae8d08242 pathspec: pass directory indicator to
match_pathspec_item()) the path matching logic has been able to cope
with submodules without needing to strip off a trailing slash if a path
refers to a submodule.

Since the stripping the trailing slash is no longer necessary, remove
the PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flag.  In addition, factor
out the logic which dies if a path decends into a submodule so that it
can still be used as a check after a pathspec struct has been
initialized.

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: 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>
</feed>
