Function: projectile-vcs-ignored-file-p

projectile-vcs-ignored-file-p is a byte-compiled function defined in projectile.el.

Signature

(projectile-vcs-ignored-file-p FILE &optional PROJECT-ROOT VCS)

Documentation

Return non-nil if FILE is ignored by the project's version control system.

This is what Projectile's own ignore rules can't answer: under alien and hybrid indexing the file list comes from the version control system, so a file that VCS ignores is not part of the project even though nothing in projectile-globally-ignored-directories or the project's .projectile mentions it (issue #1075).

PROJECT-ROOT and VCS default to the current project's. Only git is consulted - for any other system the answer is nil, i.e. the file is treated as part of the project, which is what Projectile did for every system before.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-vcs-ignored-file-p (file &optional project-root vcs)
  "Return non-nil if FILE is ignored by the project's version control system.

This is what Projectile's own ignore rules can't answer: under `alien'
and `hybrid' indexing the file list comes from the version control
system, so a file that VCS ignores is not part of the project even
though nothing in `projectile-globally-ignored-directories' or the
project's `.projectile' mentions it (issue #1075).

PROJECT-ROOT and VCS default to the current project's.  Only git is
consulted - for any other system the answer is nil, i.e. the file is
treated as part of the project, which is what Projectile did for every
system before."
  (let* ((root (or project-root (projectile-project-root)))
         (vcs (or vcs (and root (projectile-project-vcs root)))))
    (when (and root (eq vcs 'git))
      (let ((default-directory root))
        ;; `git check-ignore' answers for one path without listing the
        ;; repository: exit code 0 means ignored, 1 means not.
        (equal 0 (process-file "git" nil nil nil "check-ignore" "-q" "--"
                               (file-relative-name file root)))))))