bbatsov / projectile

Project Interaction Library for Emacs
https://docs.projectile.mx
GNU General Public License v3.0
4.01k stars 582 forks source link

Projectile not recognizing hg projects #1802

Open M-Taan opened 2 years ago

M-Taan commented 2 years ago

Expected behavior

Going into a mercurial project and calling projectile-add-to-known-project Then when trying to switch to the newly added project using projectile-switch-project It should show the files inside that project.

Actual behavior

It's showing me files inside my home directory instead

1665309705

Steps to reproduce the problem

projectile-add-to-known-project to a mercurial project Then trying to go into that project using projectile-switch-project

Mercurial Version

version 6.2.3

Projectile version information

Projectile: 20221004.1327

Emacs version

Emacs 28.2

Operating system

Running Arch Linux: 5.19.13-arch1-1

M-Taan commented 2 years ago

It works correctly just for .emacs.d 1665310127

M-Taan commented 2 years ago

After some tinkering, it seems that it doesn't work on projects that use mercurial, but works just fine for git projects. I'll update the issue accordingly.

bbatsov commented 2 years ago

I haven't used Mercurial in ages - it's possible that our project detection there is broken. Should be an easy thing to fix.

zilti commented 2 years ago

In fact, not just Mercurial projects aren't being detected, but neither are Fossil. And using an empty .projectile file also does not work.

bbatsov commented 2 years ago

@zilti I'll try to find some time to reproduce this, but the logic for project detection hasn't been change in a while. This definitely makes me wonder what has happened. You can try setting a breakpoint in projectile-project-root (or rather one of the root detection functions it calls) and see what happens there.

bbatsov commented 2 years ago

I've tested this with .projectile project just now and it works fine for me.

bbatsov commented 2 years ago

I also cloned a Mercurial project now and it works fine:

image

So, I can't reproduce any of the problems outline here.

bbatsov commented 2 years ago

Are you using the latest version of Projectile? Perhaps you can post your config here?

At any rate - it'd be good to do the debugging exercise I suggested earlier.

M-Taan commented 2 years ago

Hey @bbatsov, I'll give it a try in my free time and try what you suggested earlier.

zilti commented 2 years ago

My Projectile version is 2.6.0-snapshot, the one that comes with Doom Emacs. It seems Doom manipulates the variables for project detection. Weirdly though .projectile does not work there even though they left it in... Anyway I will open an issue over @doomemacs.

bbatsov commented 2 years ago

I forgot to mention that the debugging instructions are here https://docs.projectile.mx/projectile/troubleshooting.html#debugging-projectile-commands

M-Taan commented 2 years ago

Hey, adding .projectile did indeed work with Mercurial projects

jbwyatt4 commented 6 months ago

Hi @zilti, I am seeing something similar in Doom Emacs: https://discourse.doomemacs.org/t/projectile-does-not-seem-to-consider-non-git-repos/4611/2

Did you ever open an issue? I realize this was almost 2 years ago but trying not to duplicate things.