yysun/git-tools

Bug with long pathnames

Closed this issue · 6 comments

@yysun I use the new Gulp/Node tooling for client-side package management. This means I have a node_modules directory, and the directories in there are DEEP! Node is known for this.

My .gitignore file ignores that directory.

If I run a command (from VS or the command line, doesn't matter) that manipulates that directory, such as npm update, then Visual Studio crashes with the exception System.IO.PathTooLongException. If I disable this extension, the problem disappears.

So this extension is probably the cause. Why is it reading that directory if it is ignored, and why indeed is it reading any directory in so near to realtime?

This is a great extension as it provides features the VS git provider does not, but it's unusable in its current state. Now that the grunt/gulp/npm/node tooling has been added to VS, lots of people will run into this problem.

Quite ironically, the reason I started using this extension rather than the built-in VS git provider, is that the built-in one continually scans that directory as well!

So both providers have the same bug! :-)

I will try to re-produce and fix it. If you can send the error log, it will
help me to find out where it goes wrong.

On Fri, Dec 5, 2014 at 11:46 PM, denisz1 notifications@github.com wrote:

Quite ironically, the reason I started using this extension rather than
the built-in VS git provider, is that the built-in one continually scans
that directory as well!

So both providers have the same bug!


Reply to this email directly or view it on GitHub
#1 (comment).

@denisz1 I was able to reproduce the issue and see the stack trace. It looks like a visual studio API bug. I used the API to detect file changes under solution folder. I guess Microsoft GIt Provider uses the same API, so it crashes too. I have raised a question to MSDN forum. https://social.msdn.microsoft.com/Forums/vstudio/en-US/9898f6d9-a448-4fdb-b693-ec9bfd8c4c42/ivsfilechangeeventsfileschanged-crashes-with-systemiopathtoolongexception?forum=vsx

We will see if they can provide a workaround. Meanwhile I will try a different method without using the API.

@yysun Thanks for the update!

Yes there seems to be a problem with VS. There was a bug report on Connect, so I guess the VS team knows about it.

Is it not possible to manually ignore the node_modules directory, until they release a proper fix? Because that could be a while, maybe until VS2015 is released.

I hope there is another way to solve this problem! This extension is great...

The issue has been fixed in 1.3.1. Uploaded to Visual Studio Extension Gallery.

@yysun It works! Thanks Yiyi!