diff options
| author | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-02-15 12:51:36 +0200 |
|---|---|---|
| committer | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-02-15 12:51:36 +0200 |
| commit | 658f221e7713bca82ee7d0b6bd8411f3e6ee9ea0 (patch) | |
| tree | 6689b776db32f21120a1616fd2f91f6df2a76dbb /projectile.el | |
| parent | 12957e12ea5f4eee7419b496ed7c01c6457c1e39 (diff) | |
Fix hardcoded git command in sub-projects and add hg/svn ignored commands
- Use VCS-appropriate command in projectile-get-sub-projects-files
instead of hardcoding projectile-git-command.
- Add projectile-hg-ignored-command and projectile-svn-ignored-command
defcustoms so ignored-file filtering works for hg and svn projects
in native/hybrid indexing mode.
Diffstat (limited to 'projectile.el')
| -rw-r--r-- | projectile.el | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/projectile.el b/projectile.el index 24fe0e0..c020e8b 100644 --- a/projectile.el +++ b/projectile.el @@ -764,6 +764,12 @@ Set to nil to disable listing submodules contents." :group 'projectile :type 'string) +(defcustom projectile-hg-ignored-command "hg status -in0 ." + "Command used by projectile to get the ignored files in a hg project." + :group 'projectile + :type 'string + :package-version '(projectile . "2.10.0")) + (defcustom projectile-jj-command "jj file list -T 'path ++ \"\\0\"' --no-pager ." "Command used by projectile to get the files in a Jujutsu project." :group 'projectile @@ -805,6 +811,12 @@ Set to nil to disable listing submodules contents." :group 'projectile :type 'string) +(defcustom projectile-svn-ignored-command "svn status --no-ignore | grep '^I' | cut -c9- | tr '\\n' '\\0'" + "Command used by projectile to get the ignored files in a svn project." + :group 'projectile + :type 'string + :package-version '(projectile . "2.10.0")) + (defcustom projectile-generic-command (cond ;; we prefer fd over find @@ -1599,7 +1611,8 @@ sub-modules there)." "Determine which external command to invoke based on the project's VCS." (pcase vcs ('git projectile-git-ignored-command) - ;; TODO: Add support for other VCS + ('hg projectile-hg-ignored-command) + ('svn projectile-svn-ignored-command) (_ nil))) @@ -1645,8 +1658,9 @@ they are excluded from the results of this function." submodule)) submodules))) -(defun projectile-get-sub-projects-files (project-root _vcs) - "Get files from sub-projects for PROJECT-ROOT recursively." +(defun projectile-get-sub-projects-files (project-root vcs) + "Get files from sub-projects for PROJECT-ROOT recursively. +VCS is the version control system of the project." (flatten-tree (mapcar (lambda (sub-project) (let ((project-relative-path @@ -1654,8 +1668,7 @@ they are excluded from the results of this function." sub-project project-root)))) (mapcar (lambda (file) (concat project-relative-path file)) - ;; TODO: Seems we forgot git hardcoded here - (projectile-files-via-ext-command sub-project projectile-git-command)))) + (projectile-files-via-ext-command sub-project (projectile-get-ext-command vcs))))) (projectile-get-all-sub-projects project-root)))) (defun projectile-get-repo-ignored-files (project vcs) |
