Projectile: Determining root in nested VCSs is incorrectly handled

Created on 14 Sep 2015  路  8Comments  路  Source: bbatsov/projectile

I have my ~ under .git. I have ~/dev/ where I keep my projects. I have an svn project inside ~/dev/php/foo. When I am inside foo/bar my project root is reported as ~ instead of ~/dev/php/foo/. I am using the old-style svn layout with .svn in every directory.

Feature Request Help Wanted Question Stale

Most helpful comment

@Fuco1 I think some people might disagree with you - e.g. people who have a mono git repo with 20 Ruby or Clojure projects in it and want to be able to navigate them as one. I seem to recall such concerns being brought up in the past.

I think it'd be best if we simply made this configurable - prefer innermost or outermost project, and have everyone decide for themselves.

That should be very easy to implement and I'd gladly accept a PR tackling it.

All 8 comments

Looks like you need to change projectile-project-root-files-functions. Not yet sure how yet, I'm stuck with similar problem.

@Fuco1 Sorry about the extremely slow reply - basically the problem is the order in which the vc checks are happening. The ones looking for top-level files happen first, so you need to reorder the root functions as suggested by @Pitometsu.

I am using the old-style svn layout with .svn in every directory.

What's the new one, btw?

Newer versions of svn have one .svn in the root of the project same as .git.

Wouldn't a good strategy be to get all the functions return whatever they think and then get the most-nested path? I can't think of a counter-example now where this would not be what I want.

I have

 '(projectile-project-root-files-functions
   (quote
    (projectile-root-local projectile-root-top-down projectile-root-bottom-up projectile-root-top-down-recurring)))

as personal setup.

@Fuco1 I think some people might disagree with you - e.g. people who have a mono git repo with 20 Ruby or Clojure projects in it and want to be able to navigate them as one. I seem to recall such concerns being brought up in the past.

I think it'd be best if we simply made this configurable - prefer innermost or outermost project, and have everyone decide for themselves.

That should be very easy to implement and I'd gladly accept a PR tackling it.

I have my home in git and would like to be able to still use nested projects correctly.
For my use-case, it might be enough to not recurse higher, despite finding .git there, if the current folder is ignored in the level above?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

Was this page helpful?
0 / 5 - 0 ratings