diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-11-27 01:17:46 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-30 17:28:09 -0800 |
commit | 9037026d34907c0c94e3ab46f96068fa57da6ebc (patch) | |
tree | 420b92db44369dd874ca93b4ae3aa28da7736034 /Documentation/RelNotes/1.6.5.8.txt | |
parent | unpack-trees: move all skip-worktree checks back to unpack_trees() (diff) | |
download | tgif-9037026d34907c0c94e3ab46f96068fa57da6ebc.tar.xz |
unpack-trees: fix sparse checkout's "unable to match directories"
Matching index entries against an excludes file currently has two
problems.
First, there's no function to do it. Code paths (like sparse
checkout) that wanted to try it would iterate over index entries and
for each index entry pass that path to excluded_from_list(). But that
is not how excluded_from_list() works; one is supposed to feed in each
ancester of a path before a given path to find out if it was excluded
because of some parent or grandparent matching a
bigsubdirectory/
pattern despite the path not matching any .gitignore pattern directly.
Second, it's inefficient. The excludes mechanism is supposed to let
us block off vast swaths of the filesystem as uninteresting; separately
checking every index entry doesn't fit that model.
Introduce a new function to take care of both these problems. This
traverses the index in depth-first order (well, that's what order the
index is in) to mark un-excluded entries.
Maybe some day the in-core index format will be restructured to make
this sort of operation easier. Or maybe we will want to try some
binary search based thing. The interface is simple enough to allow
all those things. Example:
clear_ce_flags(the_index.cache, the_index.cache_nr,
CE_CANDIDATE, CE_CLEARME, exclude_list);
would clear the CE_CLEARME flag on all index entries with
CE_CANDIDATE flag and not matched by exclude_list.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/RelNotes/1.6.5.8.txt')
0 files changed, 0 insertions, 0 deletions