<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.c, branch v2.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-02-05T22:54:11Z</updated>
<entry>
<title>Merge branch 'nd/exclusion-regression-fix' into maint</title>
<updated>2016-02-05T22:54:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-05T22:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9496acc1449e3e536f50eed081df0702b54cf0a8'/>
<id>urn:sha1:9496acc1449e3e536f50eed081df0702b54cf0a8</id>
<content type='text'>
The ignore mechanism saw a few regressions around untracked file
listing and sparse checkout selection areas in 2.7.0; the change
that is responsible for the regression has been reverted.

* nd/exclusion-regression-fix:
  Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"
</content>
</entry>
<entry>
<title>Merge branch 'nd/dir-exclude-cleanup' into maint</title>
<updated>2016-02-05T22:54:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-05T22:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=af3e464a60d43ebf0431aa291014d32983a502e2'/>
<id>urn:sha1:af3e464a60d43ebf0431aa291014d32983a502e2</id>
<content type='text'>
The "exclude_list" structure has the usual "alloc, nr" pair of
fields to be used by ALLOC_GROW(), but clear_exclude_list() forgot
to reset 'alloc' to 0 when it cleared 'nr' to discard the managed
array.

* nd/dir-exclude-cleanup:
  dir.c: clean the entire struct in clear_exclude_list()
</content>
</entry>
<entry>
<title>Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"</title>
<updated>2016-01-08T19:24:14Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-01-08T12:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c722360d1277259d4baec951e1488086f775214'/>
<id>urn:sha1:8c722360d1277259d4baec951e1488086f775214</id>
<content type='text'>
This reverts commit 57534ee77d22e725d971ee89c77dc6aad61c573f. The
feature added in that commit requires that patterns behave the same way
from anywhere. But some patterns can behave differently depending on
current "working" directory. The conditions to catch and avoid these
patterns are too loose. The untracked listing[1] and sparse-checkout
selection[2] can become incorrect as a result.

  [1] http://article.gmane.org/gmane.comp.version-control.git/283520
  [2] http://article.gmane.org/gmane.comp.version-control.git/283532

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>dir.c: clean the entire struct in clear_exclude_list()</title>
<updated>2015-12-28T20:48:27Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2015-12-27T01:54:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2653a8c6fa0466828061a3132421cf13a5d6d924'/>
<id>urn:sha1:2653a8c6fa0466828061a3132421cf13a5d6d924</id>
<content type='text'>
Make sure "el" can be reuseable again. The problem was el-&gt;alloc is
not cleared and may cause segfaults next time because add_exclude()
thinks el-&gt;excludes (being NULL) has enough space. Just clear the
entire struct to be safe.

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>Merge branch 'dt/name-hash-dir-entry-fix'</title>
<updated>2015-10-29T20:59:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-29T20:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=69fe31887bf8be496bb0adb4db3150cec52e1a2c'/>
<id>urn:sha1:69fe31887bf8be496bb0adb4db3150cec52e1a2c</id>
<content type='text'>
The name-hash subsystem that is used to cope with case insensitive
filesystems keeps track of directories and their on-filesystem
cases for all the paths in the index by holding a pointer to a
randomly chosen cache entry that is inside the directory (for its
ce-&gt;ce_name component).  This pointer was not updated even when the
cache entry was removed from the index, leading to use after free.
This was fixed by recording the path for each directory instead of
borrowing cache entries and restructuring the API somewhat.

* dt/name-hash-dir-entry-fix:
  name-hash: don't reuse cache_entry in dir_entry
</content>
</entry>
<entry>
<title>name-hash: don't reuse cache_entry in dir_entry</title>
<updated>2015-10-21T19:47:38Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2015-10-21T17:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41284eb0f944fe2d73708bb4105a8e3ccd0297df'/>
<id>urn:sha1:41284eb0f944fe2d73708bb4105a8e3ccd0297df</id>
<content type='text'>
Stop reusing cache_entry in dir_entry; doing so causes a
use-after-free bug.

During merges, we free entries that we no longer need in the
destination index.  But those entries might have also been stored in
the dir_entry cache, and when a later call to add_to_index found them,
they would be used after being freed.

To prevent this, change dir_entry to store a copy of the name instead
of a pointer to a cache_entry.  This entails some refactoring of code
that expects the cache_entry.

Keith McGuigan &lt;kmcguigan@twitter.com&gt; diagnosed this bug and wrote
the initial patch, but this version does not use any of Keith's code.

Helped-by: Keith McGuigan &lt;kmcguigan@twitter.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/war-on-sprintf'</title>
<updated>2015-10-20T22:24:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-20T22:24:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78891795df91a313fac590dd6cff9d8aace0dc9a'/>
<id>urn:sha1:78891795df91a313fac590dd6cff9d8aace0dc9a</id>
<content type='text'>
Many allocations that is manually counted (correctly) that are
followed by strcpy/sprintf have been replaced with a less error
prone constructs such as xstrfmt.

Macintosh-specific breakage was noticed and corrected in this
reroll.

* jk/war-on-sprintf: (70 commits)
  name-rev: use strip_suffix to avoid magic numbers
  use strbuf_complete to conditionally append slash
  fsck: use for_each_loose_file_in_objdir
  Makefile: drop D_INO_IN_DIRENT build knob
  fsck: drop inode-sorting code
  convert strncpy to memcpy
  notes: document length of fanout path with a constant
  color: add color_set helper for copying raw colors
  prefer memcpy to strcpy
  help: clean up kfmclient munging
  receive-pack: simplify keep_arg computation
  avoid sprintf and strcpy with flex arrays
  use alloc_ref rather than hand-allocating "struct ref"
  color: add overflow checks for parsing colors
  drop strcpy in favor of raw sha1_to_hex
  use sha1_to_hex_r() instead of strcpy
  daemon: use cld-&gt;env_array when re-spawning
  stat_tracking_info: convert to argv_array
  http-push: use an argv_array for setup_revisions
  fetch-pack: use argv_array for index-pack / unpack-objects
  ...
</content>
</entry>
<entry>
<title>Merge branch 'js/icase-wt-detection'</title>
<updated>2015-10-15T22:43:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-15T22:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6652939ce8cacb147bce2f0c3503486915ca5a73'/>
<id>urn:sha1:6652939ce8cacb147bce2f0c3503486915ca5a73</id>
<content type='text'>
On a case insensitive filesystems, setting GIT_WORK_TREE variable
using a random cases that does not agree with what the filesystem
thinks confused Git that it wasn't inside the working tree.

* js/icase-wt-detection:
  setup: fix "inside work tree" detection on case-insensitive filesystems
</content>
</entry>
<entry>
<title>Merge branch 'nd/ignore-then-not-ignore'</title>
<updated>2015-10-07T20:38:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-07T20:38:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=506d8f1b394917c345965fc1762afa66678870c1'/>
<id>urn:sha1:506d8f1b394917c345965fc1762afa66678870c1</id>
<content type='text'>
Allow a later "!/abc/def" to override an earlier "/abc" that
appears in the same .gitignore file to make it easier to express
"everything in /abc directory is ignored, except for ...".

* nd/ignore-then-not-ignore:
  dir.c: don't exclude whole dir prematurely if neg pattern may match
  dir.c: make last_exclude_matching_from_list() run til the end
</content>
</entry>
<entry>
<title>use strbuf_complete to conditionally append slash</title>
<updated>2015-10-05T18:08:06Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T21:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00b6c178c3ab475098f7a0bc63b2df2da508020c'/>
<id>urn:sha1:00b6c178c3ab475098f7a0bc63b2df2da508020c</id>
<content type='text'>
When working with paths in strbufs, we frequently want to
ensure that a directory contains a trailing slash before
appending to it. We can shorten this code (and make the
intent more obvious) by calling strbuf_complete.

Most of these cases are trivially identical conversions, but
there are two things to note:

  - in a few cases we did not check that the strbuf is
    non-empty (which would lead to an out-of-bounds memory
    access). These were generally not triggerable in
    practice, either from earlier assertions, or typically
    because we would have just fed the strbuf to opendir(),
    which would choke on an empty path.

  - in a few cases we indexed the buffer with "original_len"
    or similar, rather than the current sb-&gt;len, and it is
    not immediately obvious from the diff that they are the
    same. In all of these cases, I manually verified that
    the strbuf does not change between the assignment and
    the strbuf_complete call.

This does not convert cases which look like:

  if (sb-&gt;len &amp;&amp; !is_dir_sep(sb-&gt;buf[sb-&gt;len - 1]))
	  strbuf_addch(sb, '/');

as those are obviously semantically different. Some of these
cases arguably should be doing that, but that is out of
scope for this change, which aims purely for cleanup with no
behavior change (and at least it will make such sites easier
to find and examine in the future, as we can grep for
strbuf_complete).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
