<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.h, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-01-24T05:19:10Z</updated>
<entry>
<title>Merge branch 'as/check-ignore'</title>
<updated>2013-01-24T05:19:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-24T05:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a39b15b4f6a3f08b67b17d968935d177821e680f'/>
<id>urn:sha1:a39b15b4f6a3f08b67b17d968935d177821e680f</id>
<content type='text'>
Add a new command "git check-ignore" for debugging .gitignore
files.

The variable names may want to get cleaned up but that can be done
in-tree.

* as/check-ignore:
  clean.c, ls-files.c: respect encapsulation of exclude_list_groups
  t0008: avoid brace expansion
  add git-check-ignore sub-command
  setup.c: document get_pathspec()
  add.c: extract new die_if_path_beyond_symlink() for reuse
  add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
  pathspec.c: rename newly public functions for clarity
  add.c: move pathspec matchers into new pathspec.c for reuse
  add.c: remove unused argument from validate_pathspec()
  dir.c: improve docs for match_pathspec() and match_pathspec_depth()
  dir.c: provide clear_directory() for reclaiming dir_struct memory
  dir.c: keep track of where patterns came from
  dir.c: use a single struct exclude_list per source of excludes

Conflicts:
	builtin/ls-files.c
	dir.c
</content>
</entry>
<entry>
<title>Merge branch 'as/dir-c-cleanup'</title>
<updated>2013-01-10T21:47:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-10T21:47:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d912b0e44f82dc430a4aac8566a8217b60629638'/>
<id>urn:sha1:d912b0e44f82dc430a4aac8566a8217b60629638</id>
<content type='text'>
Refactor and generally clean up the directory traversal API
implementation.

* as/dir-c-cleanup:
  dir.c: rename free_excludes() to clear_exclude_list()
  dir.c: refactor is_path_excluded()
  dir.c: refactor is_excluded()
  dir.c: refactor is_excluded_from_list()
  dir.c: rename excluded() to is_excluded()
  dir.c: rename excluded_from_list() to is_excluded_from_list()
  dir.c: rename path_excluded() to is_path_excluded()
  dir.c: rename cryptic 'which' variable to more consistent name
  Improve documentation and comments regarding directory traversal API
  api-directory-listing.txt: update to match code
</content>
</entry>
<entry>
<title>dir.c: improve docs for match_pathspec() and match_pathspec_depth()</title>
<updated>2013-01-06T22:26:37Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2013-01-06T16:58:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52ed1894b04e7664feaee85c0f14360b415a755c'/>
<id>urn:sha1:52ed1894b04e7664feaee85c0f14360b415a755c</id>
<content type='text'>
Fix a grammatical issue in the description of these functions, and
make it more obvious how and why seen[] can be reused across multiple
invocations.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: provide clear_directory() for reclaiming dir_struct memory</title>
<updated>2013-01-06T22:26:37Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2013-01-06T16:58:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=270be8160493eb25ee43eb7db8dda2504343dc65'/>
<id>urn:sha1:270be8160493eb25ee43eb7db8dda2504343dc65</id>
<content type='text'>
By the end of a directory traversal, a dir_struct instance will
typically contains pointers to various data structures on the heap.
clear_directory() provides a convenient way to reclaim that memory.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: keep track of where patterns came from</title>
<updated>2013-01-06T22:26:37Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2013-01-06T16:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c04318e46aae79b8b8df059e2118519d83dfee12'/>
<id>urn:sha1:c04318e46aae79b8b8df059e2118519d83dfee12</id>
<content type='text'>
For exclude patterns read in from files, the filename is stored in the
exclude list, and the originating line number is stored in the
individual exclude (counting starting at 1).

For exclude patterns provided on the command line, a string describing
the source of the patterns is stored in the exclude list, and the
sequence number assigned to each exclude pattern is negative, with
counting starting at -1.  So for example the 2nd pattern provided via
--exclude would be numbered -2.  This allows any future consumers of
that data to easily distinguish between exclude patterns from files
vs. from the CLI.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: use a single struct exclude_list per source of excludes</title>
<updated>2013-01-06T22:25:06Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2013-01-06T16:58:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c082df24539329c2e75395cf378f0a3fe187c028'/>
<id>urn:sha1:c082df24539329c2e75395cf378f0a3fe187c028</id>
<content type='text'>
Previously each exclude_list could potentially contain patterns
from multiple sources.  For example dir-&gt;exclude_list[EXC_FILE]
would typically contain patterns from .git/info/exclude and
core.excludesfile, and dir-&gt;exclude_list[EXC_DIRS] could contain
patterns from multiple per-directory .gitignore files during
directory traversal (i.e. when dir-&gt;exclude_stack was more than
one item deep).

We split these composite exclude_lists up into three groups of
exclude_lists (EXC_CMDL / EXC_DIRS / EXC_FILE as before), so that each
exclude_list now contains patterns from a single source.  This will
allow us to cleanly track the origin of each pattern simply by adding
a src field to struct exclude_list, rather than to struct exclude,
which would make memory management of the source string tricky in the
EXC_DIRS case where its contents are dynamically generated.

Similarly, by moving the filebuf member from struct exclude_stack to
struct exclude_list, it allows us to track and subsequently free
memory buffers allocated during the parsing of all exclude files,
rather than only tracking buffers allocated for files in the EXC_DIRS
group.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: rename free_excludes() to clear_exclude_list()</title>
<updated>2012-12-28T20:07:47Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2012-12-27T02:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f61988125130ac091bfb69bda5d62b0ad8f054c4'/>
<id>urn:sha1:f61988125130ac091bfb69bda5d62b0ad8f054c4</id>
<content type='text'>
It is clearer to use a 'clear_' prefix for functions which empty
and deallocate the contents of a data structure without freeing
the structure itself, and a 'free_' prefix for functions which
also free the structure itself.

http://article.gmane.org/gmane.comp.version-control.git/206128

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: refactor is_path_excluded()</title>
<updated>2012-12-28T20:07:46Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2012-12-27T02:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a35341a86ecf354d46cf326ed9e0ffbceb54309d'/>
<id>urn:sha1:a35341a86ecf354d46cf326ed9e0ffbceb54309d</id>
<content type='text'>
In a similar way to the previous commit, this extracts a new helper
function last_exclude_matching_path() which return the last
exclude_list element which matched, or NULL if no match was found.
is_path_excluded() becomes a wrapper around this, and just returns 0
or 1 depending on whether any matching exclude_list element was found.

This allows callers to find out _why_ a given path was excluded,
rather than just whether it was or not, paving the way for a new git
sub-command which allows users to test their exclude lists from the
command line.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: rename excluded() to is_excluded()</title>
<updated>2012-12-28T20:07:46Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2012-12-27T02:32:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d24e7a807922a5fbf1aa4d42f66e4f0a0aaa141'/>
<id>urn:sha1:6d24e7a807922a5fbf1aa4d42f66e4f0a0aaa141</id>
<content type='text'>
Continue adopting clearer names for exclude functions.  This is_*
naming pattern for functions returning booleans was discussed here:

http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: rename excluded_from_list() to is_excluded_from_list()</title>
<updated>2012-12-28T20:07:46Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2012-12-27T02:32:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0795805053ad89a24954684fca2e69fea2bf50b9'/>
<id>urn:sha1:0795805053ad89a24954684fca2e69fea2bf50b9</id>
<content type='text'>
Continue adopting clearer names for exclude functions.  This 'is_*'
naming pattern for functions returning booleans was discussed here:

http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924

Also adjust their callers as necessary.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
