• Karsten Blees's avatar
    dir.c: git-status --ignored: don't scan the work tree twice · 0aaf62b6
    Karsten Blees authored
    'git-status --ignored' still scans the work tree twice to collect
    untracked and ignored files, respectively.
    
    fill_directory / read_directory already supports collecting untracked and
    ignored files in a single directory scan. However, the DIR_COLLECT_IGNORED
    flag to enable this has some git-add specific side-effects (e.g. it
    doesn't recurse into ignored directories, so listing ignored files with
    --untracked=all doesn't work).
    
    The DIR_SHOW_IGNORED flag doesn't list untracked files and returns ignored
    files in dir_struct.entries[] (instead of dir_struct.ignored[] as
    DIR_COLLECT_IGNORED). DIR_SHOW_IGNORED is used all throughout git.
    
    We don't want to break the existing API, so lets introduce a new flag
    DIR_SHOW_IGNORED_TOO that lists untracked as well as ignored files similar
    to DIR_COLLECT_FILES, but will recurse into sub-directories based on the
    other flags as DIR_SHOW_IGNORED does.
    
    In dir.c::read_directory_recursive, add ignored files to either
    dir_struct.entries[] or dir_struct.ignored[] based on the flags. Also move
    the DIR_COLLECT_IGNORED case here so that filling result lists is in a
    common place.
    
    In wt-status.c::wt_status_collect_untracked, use the new flag and read
    results from dir_struct.ignored[]. Remove the extra fill_directory call.
    
    builtin/check-ignore.c doesn't call fill_directory, setting the git-add
    specific DIR_COLLECT_IGNORED flag has no effect here. Remove for clarity.
    
    Update API documentation to reflect the changes.
    
    Performance: with this patch, 'git-status --ignored' is typically as fast
    as 'git-status'.
    Signed-off-by: default avatarKarsten Blees <blees@dcon.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    0aaf62b6
Name
Last commit
Last update
..
add.c Loading commit data...
annotate.c Loading commit data...
apply.c Loading commit data...
archive.c Loading commit data...
bisect--helper.c Loading commit data...
blame.c Loading commit data...
branch.c Loading commit data...
bundle.c Loading commit data...
cat-file.c Loading commit data...
check-attr.c Loading commit data...
check-ignore.c Loading commit data...
check-ref-format.c Loading commit data...
checkout-index.c Loading commit data...
checkout.c Loading commit data...
clean.c Loading commit data...
clone.c Loading commit data...
column.c Loading commit data...
commit-tree.c Loading commit data...
commit.c Loading commit data...
config.c Loading commit data...
count-objects.c Loading commit data...
credential.c Loading commit data...
describe.c Loading commit data...
diff-files.c Loading commit data...
diff-index.c Loading commit data...
diff-tree.c Loading commit data...
diff.c Loading commit data...
fast-export.c Loading commit data...
fetch-pack.c Loading commit data...
fetch.c Loading commit data...
fmt-merge-msg.c Loading commit data...
for-each-ref.c Loading commit data...
fsck.c Loading commit data...
gc.c Loading commit data...
grep.c Loading commit data...
hash-object.c Loading commit data...
help.c Loading commit data...
index-pack.c Loading commit data...
init-db.c Loading commit data...
log.c Loading commit data...
ls-files.c Loading commit data...
ls-remote.c Loading commit data...
ls-tree.c Loading commit data...
mailinfo.c Loading commit data...
mailsplit.c Loading commit data...
merge-base.c Loading commit data...
merge-file.c Loading commit data...
merge-index.c Loading commit data...
merge-ours.c Loading commit data...
merge-recursive.c Loading commit data...
merge-tree.c Loading commit data...
merge.c Loading commit data...
mktag.c Loading commit data...
mktree.c Loading commit data...
mv.c Loading commit data...
name-rev.c Loading commit data...
notes.c Loading commit data...
pack-objects.c Loading commit data...
pack-redundant.c Loading commit data...
pack-refs.c Loading commit data...
patch-id.c Loading commit data...
prune-packed.c Loading commit data...
prune.c Loading commit data...
push.c Loading commit data...
read-tree.c Loading commit data...
receive-pack.c Loading commit data...
reflog.c Loading commit data...
remote-ext.c Loading commit data...
remote-fd.c Loading commit data...
remote.c Loading commit data...
replace.c Loading commit data...
rerere.c Loading commit data...
reset.c Loading commit data...
rev-list.c Loading commit data...
rev-parse.c Loading commit data...
revert.c Loading commit data...
rm.c Loading commit data...
send-pack.c Loading commit data...
shortlog.c Loading commit data...
show-branch.c Loading commit data...
show-ref.c Loading commit data...
stripspace.c Loading commit data...
symbolic-ref.c Loading commit data...
tag.c Loading commit data...
tar-tree.c Loading commit data...
unpack-file.c Loading commit data...
unpack-objects.c Loading commit data...
update-index.c Loading commit data...
update-ref.c Loading commit data...
update-server-info.c Loading commit data...
upload-archive.c Loading commit data...
var.c Loading commit data...
verify-pack.c Loading commit data...
verify-tag.c Loading commit data...
write-tree.c Loading commit data...