akonwi/git-plus

Repos not detected if they are subfolders

Opened this issue · 4 comments

I recently reorganized some of my repos that I have for school so that instead of them being all separate folders in my Dev folder:

Dev\CSC230
Dev\CSC246
Dev\CSC236
...

They are now all under a Dev\School\ folder:

Dev\School\CSC230
Dev\School\CSC246
Dev\School\CSC236
...

This way, I can just add the School folder to Atom as a project folder, rather than adding all of the course folders individually.

However, I've found that, now that School is the folder in the project sidebar, the course folders don't get detected as git repos.

I assume this means that git-plus doesn't check past the top-level folders in the project sidebar for the presence of .git folders (or something).

Is there a setting that I'm missing that would enable this feature, or is it simply not possible without a change on your side? If that is the case, consider this a friendly request for this functionality :)

Unfortunately Atom doesn't work this way. Initally, an atom project could only have one root directory and if it was a repo, awesome. Otherwise no git functionality. Now, a window can have multiple root directories but they still work the same way. If these roots are repos, then atom will treat them as such. This package used to get around that by trying to find the git context around each open file. That is very expensive though and lead to poor performance and required a lot of extra work.

With the release of atom 1.0, there were api's for packages to get the repos of a project based on what root directories were open. I switched to using that because it was lightweight and more official. The trade-off is that the package now only allows doing git where atom notices git, which unfortunately isn't everywhere.

#280 is similar to this and I've been thinking of a clean way to do it. I think the best solution is for the atom api to do this inherently for packages to consume. I might have to make a pull request to get this functionality

That does sound like it would be the easiest way... If you do end up going that route, it'd be great if you could add a link to that pull request here, just for posterity.

👍

Updated link to atom issue (atom/atom#2203)