bbatsov/projectile — pull request #464 by tuhdo (2014-10-10 19:47:42+00:00)
Title: Add file listing for sub-projects to Projectile

Add the ability for Projectile to automatically see sub-projects in a project like Git submodule. It can handle cycle submodules (submodules that can include itself as submodules and create a loop). The scenario is described in details in function projectile-get-all-sub-projects.

Demo (begins when START DEMO appears in minibuffer):

In the first demo, I already cloned [yasnippet](https://github.com/capitaomorte/yasnippet), and then listed its submodules. The output showed that I got 3 submodules:

- Two from yasnippet: `snippets` and `yasmate`. The interesting thing is that inside each of `yasmate` submodules also contain submodules, and these submodules are actually pointed to itself.

- One I added myself, that is another `yasnippet` inside the current yasnippet to further demonstrate handling of loop submodules. The nested `yasnippet` also has the problem described above.

![git-submodules-recursive](https://cloud.githubusercontent.com/assets/4818719/4598032/33b99eb6-50b4-11e4-92fb-4d5d3801624c.gif)

The next demo shows the result of this commit:

- The file listing in `helm-projectile-find-file` includes submodule files, that are `yasnippet`, `snippets` and `yasmate` in that order. In the end, you can even see that the narrow files from `yasmate` pattern comes from two submodules: One belongs to the nested `yasnippet` and one belongs to the current `yasnippet`.

![helm-projectile-find-files-submodules](https://cloud.githubusercontent.com/assets/4818719/4598034/3f23ff76-50b4-11e4-90cb-d8e44935f88d.gif)

My only remaining concern is the command to get submodule list in current project:

```lisp
(defcustom projectile-git-submodule-command "git submodule | awk '{ print $2 }' | tr '\\n' '\\0' | sed -e 's/ //g'"
"Command used by projectile to get the files in a git project."
:group 'projectile
:type 'string)
```

Aside from `git submodule` command, I will convert the remaining to Elisp for portability.