atom-git-control icon indicating copy to clipboard operation
atom-git-control copied to clipboard

non vcs project show this error

Open ginus opened this issue 10 years ago • 7 comments

Failed to activate package named 'git-control' TypeError: Cannot read property 'getWorkingDirectory' of null at Object. (c:\Users\Administrator.atom\packages\git-control\lib\git.coffee:16:13)

ginus avatar Jan 18 '15 10:01 ginus

Same here.

MaximeWillinger avatar Apr 24 '15 08:04 MaximeWillinger

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: img Is there something else that could be done in this case ( opening a non vcs project )?

MarcelMue avatar Apr 24 '15 11:04 MarcelMue

@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 avatar Apr 24 '15 12:04 MaximeWillinger

@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.

MarcelMue avatar Apr 24 '15 21:04 MarcelMue

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 ;-)

hellerbarde avatar Jul 15 '15 13:07 hellerbarde

I'm also having the same problem, do not know if the OS can influence, but I'm using ElementaryOS.

ribeiroevandro avatar Sep 04 '15 01:09 ribeiroevandro

Is this bug still a problem?

hellerbarde avatar Apr 03 '16 17:04 hellerbarde