<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.c, branch v2.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-11-03T23:32:40Z</updated>
<entry>
<title>Merge branch 'dt/name-hash-dir-entry-fix' into maint</title>
<updated>2015-11-03T23:32:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-11-03T23:32:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a27eec48ecfcc0764c90b3f478a124c01c082bc'/>
<id>urn:sha1:3a27eec48ecfcc0764c90b3f478a124c01c082bc</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 'js/icase-wt-detection' into maint</title>
<updated>2015-10-16T21:32:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-16T21:32:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15cef7ccd93d790fbe162de66366c4878ddaf921'/>
<id>urn:sha1:15cef7ccd93d790fbe162de66366c4878ddaf921</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>setup: fix "inside work tree" detection on case-insensitive filesystems</title>
<updated>2015-09-28T17:49:06Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2015-09-28T16:12:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63ec5e1fecc14b0dd5452f0a2b80641600b03437'/>
<id>urn:sha1:63ec5e1fecc14b0dd5452f0a2b80641600b03437</id>
<content type='text'>
Git has a config variable to indicate that it is operating on a file
system that is case-insensitive: core.ignoreCase. But the
`dir_inside_of()` function did not respect that. As a result, if Git's
idea of the current working directory disagreed in its upper/lower case
with the `GIT_WORK_TREE` variable (e.g. `C:\test` vs `c:\test`) the
user would be greeted by the error message

	fatal: git-am cannot be used without a working tree.

when trying to run a rebase.

This fixes https://github.com/git-for-windows/git/issues/402 (reported by
Daniel Harding).

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dt/untracked-subdir' into maint</title>
<updated>2015-09-17T19:12:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-17T19:12:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8833ccd7d020a6160240a4933be91370e6f59c48'/>
<id>urn:sha1:8833ccd7d020a6160240a4933be91370e6f59c48</id>
<content type='text'>
The experimental untracked-cache feature were buggy when paths with
a few levels of subdirectories are involved.

* dt/untracked-subdir:
  untracked cache: fix entry invalidation
  untracked-cache: fix subdirectory handling
  t7063: use --force-untracked-cache to speed up a bit
  untracked-cache: support sparse checkout
</content>
</entry>
<entry>
<title>Merge branch 'dt/untracked-subdir'</title>
<updated>2015-08-28T19:32:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-28T19:32:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=038226ebc6ec1b82af639fa1d943684c07dd8f72'/>
<id>urn:sha1:038226ebc6ec1b82af639fa1d943684c07dd8f72</id>
<content type='text'>
The experimental untracked-cache feature were buggy when paths with
a few levels of subdirectories are involved.

* dt/untracked-subdir:
  untracked cache: fix entry invalidation
  untracked-cache: fix subdirectory handling
</content>
</entry>
<entry>
<title>Merge branch 'jk/git-path'</title>
<updated>2015-08-19T21:48:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-19T21:48:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c9155e031869293b99531a25b585e49f74beaba'/>
<id>urn:sha1:8c9155e031869293b99531a25b585e49f74beaba</id>
<content type='text'>
git_path() and mkpath() are handy helper functions but it is easy
to misuse, as the callers need to be careful to keep the number of
active results below 4.  Their uses have been reduced.

* jk/git-path:
  memoize common git-path "constant" files
  get_repo_path: refactor path-allocation
  find_hook: keep our own static buffer
  refs.c: remove_empty_directories can take a strbuf
  refs.c: avoid git_path assignment in lock_ref_sha1_basic
  refs.c: avoid repeated git_path calls in rename_tmp_log
  refs.c: simplify strbufs in reflog setup and writing
  path.c: drop git_path_submodule
  refs.c: remove extra git_path calls from read_loose_refs
  remote.c: drop extraneous local variable from migrate_file
  prefer mkpathdup to mkpath in assignments
  prefer git_pathdup to git_path in some possibly-dangerous cases
  add_to_alternates_file: don't add duplicate entries
  t5700: modernize style
  cache.h: complete set of git_path_submodule helpers
  cache.h: clarify documentation for git_path, et al
</content>
</entry>
<entry>
<title>Merge branch 'cb/uname-in-untracked' into maint</title>
<updated>2015-08-19T21:41:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-19T21:41:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b083703ce34b27a0f97d7e2d4d2eec196a53b707'/>
<id>urn:sha1:b083703ce34b27a0f97d7e2d4d2eec196a53b707</id>
<content type='text'>
An experimental "untracked cache" feature used uname(2) in a
slightly unportable way.

* cb/uname-in-untracked:
  untracked: fix detection of uname(2) failure
</content>
</entry>
<entry>
<title>untracked cache: fix entry invalidation</title>
<updated>2015-08-19T17:40:55Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2015-08-19T13:01:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73f9145fbf748d39dd1e145ec846a5481cf7a36f'/>
<id>urn:sha1:73f9145fbf748d39dd1e145ec846a5481cf7a36f</id>
<content type='text'>
First, the current code in untracked_cache_invalidate_path() is wrong
because it can only handle paths "a" or "a/b", not "a/b/c" because
lookup_untracked() only looks for entries directly under the given
directory. In the last case, it will look for the entry "b/c" in
directory "a" instead. This means if you delete or add an entry in a
subdirectory, untracked cache may become out of date because it does not
invalidate properly. This is noticed by David Turner.

The second problem is about invalidation inside a fully untracked/excluded
directory. In this case we may have to invalidate back to root. See the
comment block for detail.

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>untracked-cache: fix subdirectory handling</title>
<updated>2015-08-19T17:40:24Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2015-08-19T13:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e5910f27695b1b24e8a6870940bfac2a03ef0d7'/>
<id>urn:sha1:2e5910f27695b1b24e8a6870940bfac2a03ef0d7</id>
<content type='text'>
Previously, some calls lookup_untracked would pass a full path.  But
lookup_untracked assumes that the portion of the path up to and
including to the untracked_cache_dir has been removed.  So
lookup_untracked would be looking in the untracked_cache for 'foo' for
'foo/bar' (instead of just looking for 'bar').  This would cause
untracked cache corruption.

Instead, treat_directory learns to track the base length of the parent
directory, so that only the last path component is passed to
lookup_untracked.

Helped-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: David Turner &lt;dturner@twopensource.com&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>
</feed>
