OSDN Git Service

Merge branch 'jm/status-ignored-files-list'
authorJunio C Hamano <gitster@pobox.com>
Mon, 13 Nov 2017 05:44:59 +0000 (14:44 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Nov 2017 05:44:59 +0000 (14:44 +0900)
The set of paths output from "git status --ignored" was tied
closely with its "--untracked=<mode>" option, but now it can be
controlled more flexibly.  Most notably, a directory that is
ignored because it is listed to be ignored in the ignore/exclude
mechanism can be handled differently from a directory that ends up
to be ignored only because all files in it are ignored.

* jm/status-ignored-files-list:
  status: test ignored modes
  status: document options to show matching ignored files
  status: report matching ignored and normal untracked
  status: add option to show ignored files differently

1  2 
builtin/commit.c
dir.c
wt-status.c

Simple merge
diff --cc dir.c
--- 1/dir.c
--- 2/dir.c
+++ b/dir.c
@@@ -1389,10 -1389,34 +1389,34 @@@ static enum path_treatment treat_direct
        case index_nonexistent:
                if (dir->flags & DIR_SHOW_OTHER_DIRECTORIES)
                        break;
+               if (exclude &&
+                       (dir->flags & DIR_SHOW_IGNORED_TOO) &&
+                       (dir->flags & DIR_SHOW_IGNORED_TOO_MODE_MATCHING)) {
+                       /*
+                        * This is an excluded directory and we are
+                        * showing ignored paths that match an exclude
+                        * pattern.  (e.g. show directory as ignored
+                        * only if it matches an exclude pattern).
+                        * This path will either be 'path_excluded`
+                        * (if we are showing empty directories or if
+                        * the directory is not empty), or will be
+                        * 'path_none' (empty directory, and we are
+                        * not showing empty directories).
+                        */
+                       if (!(dir->flags & DIR_HIDE_EMPTY_DIRECTORIES))
+                               return path_excluded;
+                       if (read_directory_recursive(dir, istate, dirname, len,
+                                                    untracked, 1, 1, pathspec) == path_excluded)
+                               return path_excluded;
+                       return path_none;
+               }
                if (!(dir->flags & DIR_NO_GITLINKS)) {
 -                      unsigned char sha1[20];
 -                      if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0)
 -                              return path_untracked;
 +                      struct object_id oid;
 +                      if (resolve_gitlink_ref(dirname, "HEAD", &oid) == 0)
 +                              return exclude ? path_excluded : path_untracked;
                }
                return path_recurse;
        }
diff --cc wt-status.c
Simple merge