Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

how to follow symlink? #83

Closed
bling opened this Issue · 5 comments

4 participants

@bling

i'm trying to get this use case to work:

cd ~/dev
git clone repo1
git clone repo2
mkdir both
cd both
ln -s ../repo1
ln -s ../repo2
emacs

running projectile-find-file from here gives me a list of nothing (i already have projectile-require-project-root set to nil). how do i configure it to follow through all symlinks? is that possible?

thanks!

@bbatsov
Owner

I think that you're using non-native indexing this should work since it will fallback to find. I guess the Emacs Lisp code should work as well (at least in theory). No idea why its misbehaving. I'll investigate when I find some time to spare.

@sebmaynard

Find doesn't follow symlinks by default, but you can make it follow with -L; so customize-variable projectile-generic-command, then put something like:

find -L . -type f -print0
@bbatsov
Owner

In light of @sebmaynard's comment I'll consider this issue resolved.

@bbatsov bbatsov closed this
@glucas

I don't believe this is a complete solution? Modifying the find arguments as suggested does allow projectile to build the list of project files, but when I actually try to visit a file it attempts to create a file at the specified path rather than traversing the symlink. So I get an empty buffer and a warning to use M-x make-directory to create the nonexistent parent dirs.

@glucas

Never mind. The problem I was seeing had to do with my .projectile file.

Specifically:

  • I had an include rule for a subdirectory that is actually a symlink.
  • I left off the trailing slash, e.g. "+/dir"

WIth this configuration the project index included all the files under 'dir' but with a repeated path element, e.g. "/dir/dir/the/file". So projectile-find-file always failed to open the file.

If I add the trailing slash or remove the include rule, things seems to work find with symlinks.

@dhaley dhaley referenced this issue from a commit in dhaley/dot-emacs
Damon Haley bbatsov/projectile#83 e593213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.