bbatsov/projectile — pull request #548 by tuhdo (2014-11-20 05:35:17+00:00)
Title: [Fix #545] Retrieve sub-projects correctly and efficiently

Initially, the function `projectile-get-all-sub-projects` check for cycles
in sub-projects and terminate it early. Unfortunately, this approach
ignores further sub-projects down the source tree. Since using the
command "git submodule --quiet foreach 'echo $name'", it does not output
sub-project cycles like ../../bundle/html-bundle anymore, we can safely
ignore this check. We now expect external commands to return submodule
properly.

Also fix a bug that caused duplicate sub-projects. When there's no more
submodule, simply return nil. For example, this is all the sub-projects of my `yasnippet`
test project:

```text
sub-project: /home/xtuudoo/Downloads/yasnippet/
sub-project: /home/xtuudoo/Downloads/yasnippet/snippets/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasmate/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasmate/bundles/html-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasmate/bundles/objc-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasmate/bundles/rails-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasmate/bundles/ruby-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/snippets/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/html-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/objc-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/rails-tmbundle/
sub-project: /home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/ruby-tmbundle/
```

The above text is the output of the call `(message "sub-project: %s" project)` each time `projectile-get-all-sub-projects`. As you can see, those are all sub-projects and there's no duplicate. Here is output in list format run within `IELM`:

```lisp
'("/home/xtuudoo/Downloads/yasnippet/snippets/" "/home/xtuudoo/Downloads/yasnippet/yasmate/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/" "/home/xtuudoo/Downloads/yasnippet/yasmate/bundles/html-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasmate/bundles/objc-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasmate/bundles/rails-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasmate/bundles/ruby-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/snippets/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/html-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/objc-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/rails-tmbundle/" "/home/xtuudoo/Downloads/yasnippet/yasnippet/yasmate/bundles/ruby-tmbundle/")
```