Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs projectile with multiple repos (git/svn etc.) in one project

I have a single git repo with a directory structure that looks like this:

root ---------- src
        |
        |
        |------ 3rd

root is my working directory, 3rd consists of multiple third-party git submodules.
projectile-find-file only finds files in src, it does not work for the submodules.

like image 787
guoxx Avatar asked Apr 22 '14 05:04

guoxx


1 Answers

projectile-git-command uses git ls-files to list the files belonging to the project,
so I resolved the problem with the following code:

(setq projectile-git-command "git-ls-all-files")

git-ls-all-files is a shell script:

\#!/bin/zsh
files=`git ls-files -co --exclude-standard`
sb_files=`git --no-pager submodule --quiet foreach 'git ls-files --full-name -co --exclude-standard | sed s!^!$path/!'`
all_files=$files$sb_files

echo $all_files
like image 74
guoxx Avatar answered Oct 12 '22 23:10

guoxx