• 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
..
RelNotes Loading commit data...
howto Loading commit data...
technical Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
CodingGuidelines Loading commit data...
Makefile Loading commit data...
SubmittingPatches Loading commit data...
asciidoc.conf Loading commit data...
blame-options.txt Loading commit data...
build-docdep.perl Loading commit data...
cat-texi.perl Loading commit data...
cmd-list.perl Loading commit data...
config.txt Loading commit data...
date-formats.txt Loading commit data...
diff-config.txt Loading commit data...
diff-format.txt Loading commit data...
diff-generate-patch.txt Loading commit data...
diff-options.txt Loading commit data...
docbook-xsl.css Loading commit data...
docbook.xsl Loading commit data...
everyday.txt Loading commit data...
fetch-options.txt Loading commit data...
fix-texi.perl Loading commit data...
git-add.txt Loading commit data...
git-am.txt Loading commit data...
git-annotate.txt Loading commit data...
git-apply.txt Loading commit data...
git-archimport.txt Loading commit data...
git-archive.txt Loading commit data...
git-bisect-lk2009.txt Loading commit data...
git-bisect.txt Loading commit data...
git-blame.txt Loading commit data...
git-branch.txt Loading commit data...
git-bundle.txt Loading commit data...
git-cat-file.txt Loading commit data...
git-check-attr.txt Loading commit data...
git-check-ignore.txt Loading commit data...
git-check-ref-format.txt Loading commit data...
git-checkout-index.txt Loading commit data...
git-checkout.txt Loading commit data...
git-cherry-pick.txt Loading commit data...
git-cherry.txt Loading commit data...
git-citool.txt Loading commit data...
git-clean.txt Loading commit data...
git-clone.txt Loading commit data...
git-column.txt Loading commit data...
git-commit-tree.txt Loading commit data...
git-commit.txt Loading commit data...
git-config.txt Loading commit data...
git-count-objects.txt Loading commit data...
git-credential-cache--daemon.txt Loading commit data...
git-credential-cache.txt Loading commit data...
git-credential-store.txt Loading commit data...
git-credential.txt Loading commit data...
git-cvsexportcommit.txt Loading commit data...
git-cvsimport.txt Loading commit data...
git-cvsserver.txt Loading commit data...
git-daemon.txt Loading commit data...
git-describe.txt Loading commit data...
git-diff-files.txt Loading commit data...
git-diff-index.txt Loading commit data...
git-diff-tree.txt Loading commit data...
git-diff.txt Loading commit data...
git-difftool.txt Loading commit data...
git-fast-export.txt Loading commit data...
git-fast-import.txt Loading commit data...
git-fetch-pack.txt Loading commit data...
git-fetch.txt Loading commit data...
git-filter-branch.txt Loading commit data...
git-fmt-merge-msg.txt Loading commit data...
git-for-each-ref.txt Loading commit data...
git-format-patch.txt Loading commit data...
git-fsck-objects.txt Loading commit data...
git-fsck.txt Loading commit data...
git-gc.txt Loading commit data...
git-get-tar-commit-id.txt Loading commit data...
git-grep.txt Loading commit data...
git-gui.txt Loading commit data...
git-hash-object.txt Loading commit data...
git-help.txt Loading commit data...
git-http-backend.txt Loading commit data...
git-http-fetch.txt Loading commit data...
git-http-push.txt Loading commit data...
git-imap-send.txt Loading commit data...
git-index-pack.txt Loading commit data...
git-init-db.txt Loading commit data...
git-init.txt Loading commit data...
git-instaweb.txt Loading commit data...
git-log.txt Loading commit data...
git-lost-found.txt Loading commit data...
git-ls-files.txt Loading commit data...
git-ls-remote.txt Loading commit data...
git-ls-tree.txt Loading commit data...
git-mailinfo.txt Loading commit data...
git-mailsplit.txt Loading commit data...
git-merge-base.txt Loading commit data...
git-merge-file.txt Loading commit data...
git-merge-index.txt Loading commit data...
git-merge-one-file.txt Loading commit data...
git-merge-tree.txt Loading commit data...
git-merge.txt Loading commit data...
git-mergetool--lib.txt Loading commit data...
git-mergetool.txt Loading commit data...
git-mktag.txt Loading commit data...
git-mktree.txt Loading commit data...
git-mv.txt Loading commit data...
git-name-rev.txt Loading commit data...
git-notes.txt Loading commit data...
git-p4.txt Loading commit data...
git-pack-objects.txt Loading commit data...
git-pack-redundant.txt Loading commit data...
git-pack-refs.txt Loading commit data...
git-parse-remote.txt Loading commit data...
git-patch-id.txt Loading commit data...
git-peek-remote.txt Loading commit data...
git-prune-packed.txt Loading commit data...
git-prune.txt Loading commit data...
git-pull.txt Loading commit data...
git-push.txt Loading commit data...
git-quiltimport.txt Loading commit data...
git-read-tree.txt Loading commit data...
git-rebase.txt Loading commit data...
git-receive-pack.txt Loading commit data...
git-reflog.txt Loading commit data...
git-relink.txt Loading commit data...
git-remote-ext.txt Loading commit data...
git-remote-fd.txt Loading commit data...
git-remote-helpers.txto Loading commit data...
git-remote-testgit.txt Loading commit data...
git-remote.txt Loading commit data...
git-repack.txt Loading commit data...
git-replace.txt Loading commit data...
git-repo-config.txt Loading commit data...
git-request-pull.txt Loading commit data...
git-rerere.txt Loading commit data...
git-reset.txt Loading commit data...
git-rev-list.txt Loading commit data...
git-rev-parse.txt Loading commit data...
git-revert.txt Loading commit data...
git-rm.txt Loading commit data...
git-send-email.txt Loading commit data...
git-send-pack.txt Loading commit data...
git-sh-i18n--envsubst.txt Loading commit data...
git-sh-i18n.txt Loading commit data...
git-sh-setup.txt Loading commit data...
git-shell.txt Loading commit data...
git-shortlog.txt Loading commit data...
git-show-branch.txt Loading commit data...
git-show-index.txt Loading commit data...
git-show-ref.txt Loading commit data...
git-show.txt Loading commit data...
git-stage.txt Loading commit data...
git-stash.txt Loading commit data...
git-status.txt Loading commit data...
git-stripspace.txt Loading commit data...
git-submodule.txt Loading commit data...
git-svn.txt Loading commit data...
git-symbolic-ref.txt Loading commit data...
git-tag.txt Loading commit data...
git-tar-tree.txt Loading commit data...
git-tools.txt Loading commit data...
git-unpack-file.txt Loading commit data...
git-unpack-objects.txt Loading commit data...
git-update-index.txt Loading commit data...
git-update-ref.txt Loading commit data...
git-update-server-info.txt Loading commit data...
git-upload-archive.txt Loading commit data...
git-upload-pack.txt Loading commit data...
git-var.txt Loading commit data...
git-verify-pack.txt Loading commit data...
git-verify-tag.txt Loading commit data...
git-web--browse.txt Loading commit data...
git-whatchanged.txt Loading commit data...
git-write-tree.txt Loading commit data...
git.txt Loading commit data...
gitattributes.txt Loading commit data...
gitcli.txt Loading commit data...
gitcore-tutorial.txt Loading commit data...
gitcredentials.txt Loading commit data...
gitcvs-migration.txt Loading commit data...
gitdiffcore.txt Loading commit data...
gitglossary.txt Loading commit data...
githooks.txt Loading commit data...
gitignore.txt Loading commit data...
gitk.txt Loading commit data...
gitmodules.txt Loading commit data...
gitnamespaces.txt Loading commit data...
gitremote-helpers.txt Loading commit data...
gitrepository-layout.txt Loading commit data...
gitrevisions.txt Loading commit data...
gittutorial-2.txt Loading commit data...
gittutorial.txt Loading commit data...
gitweb.conf.txt Loading commit data...
gitweb.txt Loading commit data...
gitworkflows.txt Loading commit data...
glossary-content.txt Loading commit data...
howto-index.sh Loading commit data...
i18n.txt Loading commit data...
install-doc-quick.sh Loading commit data...
install-webdoc.sh Loading commit data...
mailmap.txt Loading commit data...
manpage-1.72.xsl Loading commit data...
manpage-base-url.xsl.in Loading commit data...
manpage-base.xsl Loading commit data...
manpage-bold-literal.xsl Loading commit data...
manpage-normal.xsl Loading commit data...
manpage-quote-apos.xsl Loading commit data...
manpage-suppress-sp.xsl Loading commit data...
merge-config.txt Loading commit data...
merge-options.txt Loading commit data...
merge-strategies.txt Loading commit data...
pretty-formats.txt Loading commit data...
pretty-options.txt Loading commit data...
pull-fetch-param.txt Loading commit data...
rev-list-options.txt Loading commit data...
revisions.txt Loading commit data...
sequencer.txt Loading commit data...
urls-remotes.txt Loading commit data...
urls.txt Loading commit data...
user-manual.conf Loading commit data...
user-manual.txt Loading commit data...