This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258345 - 'vendor' directory always ignored
Summary: 'vendor' directory always ignored
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 268375 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-13 12:24 UTC by mwvdlee
Modified: 2017-01-09 12:06 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mwvdlee 2016-03-13 12:24:57 UTC
In PHP, the `vendor` directory is always ignored in Git repositories, even if it's not mentioned in the `.gitignore` file. Even if I add it in `.gitignore` explicitely NOT to be ignored (`!/vendor/`).

I can't find any option to disable the ignoring. Ignoring this directory by default seems shortsighted at best, but not having the option to disable this behaviour makes it a bug.
Comment 1 Tomas Mysik 2016-03-14 06:22:44 UTC
It works as designed. If you want to version your vendor directory, simply use [1].

Thanks for reporting.
[1] git add vendor
Comment 2 mwvdlee 2016-03-14 06:56:49 UTC
How can this be as designed when it's doesn't work as Git was designed?

`git add vendor` works when using the normal command-line git, but Netbeans' implementation of `git commit` keeps ignoring the `vendor` regardless of whether it was added; any changes in the `vendor` directory keep being ignored by Netbeans and I keep having to use the command line Git.

This behaviour makes me unable to use the Git support built into Netbeans, as the Git implementation of Netbeans fails to treat the `vendor` directory as a normal directory, despite the fact that the `vendor` directory has no special meaning to Git.

At the very least there should be an option to turn off this "Ignore special folders" feature so all the projects (like Magento or basically anything that deploys using git repositories) that need to include a `vendor` directory can still use Netbeans.
Comment 3 Tomas Mysik 2016-03-14 07:11:15 UTC
(In reply to mwvdlee from comment #2)
> How can this be as designed when it's doesn't work as Git was designed?

Not git but NetBeans ;)

Our decision is based on - as we believe - common use case that "vendor" (or "node_modules" for npm etc.) directories are usually not put under SCM (and we have no report against npm or Bower so far).

So, if I can ask, what is your reason to put this directory under SCM? Your explanation could help us to understand why someone wants to do it.

Thanks.
Comment 4 mwvdlee 2016-03-14 10:12:52 UTC
My use-case is a few dozen or so PHP websites that are deployed using Git (with Gitolote and a number of scripts hooked into git, like these: https://github.com/vanderlee/gitolite-hooks). Deploying like this is fairly common and results in (near-)zero downtime. But this works if and only if all required files are in the repository. Requiring an additional step to update Composer (or indeed NPM/Bower for JS) means you need to have downtime.

Besides, there is the issue that excluding `vendor` (or `node_modules`) is trivial to do with `.gitignore` files if needed, and should (not to say "must") be done using a `.gitignore` file anyway to ensure compatibility with tools other than NetBeans. NetBeans could just as easily add the `vendor` directory to `.gitignore` by default, then allow people with use-cases similar to me to remove it (or comment it out) manually. At the very least it should allow `.gitignore` to explicitely include such folders using something like `!/vendor/`. Currently Netbeans ignores the user's choices made in `.gitignore` with regards to these folders.
Comment 5 Tomas Mysik 2016-03-14 10:36:33 UTC
OK, I will add a checkbox to the Composer Options (in IDE Options), something like "Ignore 'vendor' directory from versioning" (or any idea for better wording? ;)

I will do the same for npm and Bower tools.

Thanks for reporting.
Comment 6 mwvdlee 2016-03-14 12:37:43 UTC
That fix would be perfect.
I'm assuming they'll be enabled by default, to maintain current (8.1) functionality.
The wording seems fine to me.
Thank you!
Comment 7 Tomas Mysik 2016-03-15 07:50:23 UTC
(In reply to mwvdlee from comment #6)
> That fix would be perfect.

Great to hear!

> I'm assuming they'll be enabled by default, to maintain current (8.1)
> functionality.

Yes. Please, uncheck it (available for Bower, npm and Composer) and ideally restart the IDE.

> The wording seems fine to me.

Fine.

> Thank you!

Thank you for your report and sorry for inconveniences!

http://hg.netbeans.org/web-main/rev/681ac116d63b
http://hg.netbeans.org/web-main/rev/e6da8b9ad4e3
http://hg.netbeans.org/web-main/rev/5d92402c5e08
Comment 8 Quality Engineering 2016-03-16 03:04:59 UTC
Integrated into 'main-silver', will be available in build *201603160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/681ac116d63b
User: Tomas Mysik <tmysik@netbeans.org>
Log: #258345 - 'vendor' directory always ignored

Composer part.
Comment 9 haohuoyao 2016-10-07 02:18:17 UTC
*** Bug 268375 has been marked as a duplicate of this bug. ***
Comment 10 brunocassol 2017-01-09 02:10:55 UTC
/vendor directory still forcefully git ignored by Netbeans 8.2 even though I unchecked the option "Permanently ignore non-shareable folders" in Options > Teams > Versioning and restarted Netbeans.

I don't have /vendor/ on my .gitignore file.

(btw Netbeans for PHP is awesome!)
Comment 11 Tomas Mysik 2017-01-09 07:21:55 UTC
This issue is fixed. Please, report a new issue with _exact_ steps to reproduce. Also, always attach your IDE log [1] once the problem occurs.

Thanks.
[1] http://wiki.netbeans.org/FaqLogMessagesFile
Comment 12 brunocassol 2017-01-09 12:06:32 UTC
Thanks for your quick reply. I submitted a new issue with steps to reproduce and IDE log.

https://netbeans.org/bugzilla/show_bug.cgi?id=269514