Skip to content

Commit

Permalink
Remove "fix" for projectile + $HOME git repos
Browse files Browse the repository at this point in the history
There are legitimate reasons why a user would want to treat $HOME as a
project. 'doom doctor' now complains about this case in greater detail.
I'll leave it to users to deal with this edge case.
  • Loading branch information
hlissner committed May 24, 2021
1 parent 3a0bf17 commit e5b52e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
8 changes: 6 additions & 2 deletions core/cli/doctor.el
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ in."
(require 'projectile)
(when (projectile-project-root "~")
(warn! "Your $HOME is recognized as a project root")
(explain! "Doom will disable bottom-up root search, which may reduce the accuracy of project\n"
"detection."))
(explain! "Emacs will assume $HOME is the root of any project living under $HOME. If this isn't\n"
"desired, you will need to remove \".git\" from `projectile-project-root-files-bottom-up'\n"
"(a variable), e.g.\n\n"
" (after! projectile\n"
" (setq projectile-project-root-files-bottom-up\n"
" (remove \".git\" projectile-project-root-files-bottom-up)))"))

;; There should only be one
(when (and (file-equal-p doom-private-dir "~/.config/doom")
Expand Down
13 changes: 0 additions & 13 deletions core/core-projects.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,6 @@ c) are not valid projectile projects."
and do (remhash proot projectile-project-type-cache))
(projectile-serialize-cache))))

;; It breaks projectile's project root resolution if HOME is a project (e.g.
;; it's a git repo). In that case, we disable bottom-up root searching to
;; prevent issues. This makes project resolution a little slower and less
;; accurate in some cases.
(let ((default-directory "~"))
(when (cl-find-if #'projectile-file-exists-p
projectile-project-root-files-bottom-up)
(doom-log "HOME appears to be a project. Disabling bottom-up root search.")
(setq projectile-project-root-files
(append projectile-project-root-files-bottom-up
projectile-project-root-files)
projectile-project-root-files-bottom-up nil)))

;; Some MSYS utilities auto expanded the `/' path separator, so we need to prevent it.
(when IS-WINDOWS
(setenv "MSYS_NO_PATHCONV" "1") ; Fix path in Git Bash
Expand Down

0 comments on commit e5b52e2

Please sign in to comment.