atom-git-control
atom-git-control copied to clipboard
non vcs project show this error
Failed to activate package named 'git-control' TypeError: Cannot read property 'getWorkingDirectory' of null
at Object.
Same here.
I solved an error from popping up with this 4cc3e032df146987e959ea323a7376360e74d152 commit. However this only prevents an error message from being thrown and instead shows this message to the user:
Is there something else that could be done in this case ( opening a non vcs project )?
@MarcelMue In my case, I had the problem when I tried to open git-control on non vcs folder that contains multiple vcs folders. Maybe, in that case, we should be able to choose, in a list, for which vcs sub-folder we want to open git-control. If there is not any vcs sub-folder, then displaying an error message would be a good idea. I think a notification here is a better idea than a simple error message in an empty git-control tab (more user-friendly).
@MaximeWillinger I started playing with this locally but it seems pretty difficult so far to find repo folders. My approach right now would be to get the folders in the project root, check them for repos and then get the subfolders in the ones that aren't repos and repeat. I thougth about doing this for only 5 layers or so because otherwise the amount of folders checked could get crazy high. I am open to other approaches if anyone has a better idea, for now I am going to continue implementing it this way.
I have worked on a project that did similar things and you don't really have a choice. crawling the tree is the right/only way to do it, unless you have a registry of git folders (which we can't assume).
One thing I can say that we implemented was giving the user a setting to tweak how deep the search should be and also whether to break off the search in folders that had more than n folders (n was userconfigurable and defaulted to 30)
To be honest, one could probably set depth to 2 and n to 100 and nobody would ever notice. Oh and be sure not to recurse into the .git folders ;-)
I'm also having the same problem, do not know if the OS can influence, but I'm using ElementaryOS.
Is this bug still a problem?