{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/4895","repository_url":"https://api.github.com/repos/composer/composer","labels_url":"https://api.github.com/repos/composer/composer/issues/4895/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/4895/comments","events_url":"https://api.github.com/repos/composer/composer/issues/4895/events","html_url":"https://github.com/composer/composer/issues/4895","id":132368761,"number":4895,"title":"Keep track of packages installed only as a dependency","user":{"login":"djmattyg007","id":489338,"avatar_url":"https://avatars.githubusercontent.com/u/489338?v=3","gravatar_id":"","url":"https://api.github.com/users/djmattyg007","html_url":"https://github.com/djmattyg007","followers_url":"https://api.github.com/users/djmattyg007/followers","following_url":"https://api.github.com/users/djmattyg007/following{/other_user}","gists_url":"https://api.github.com/users/djmattyg007/gists{/gist_id}","starred_url":"https://api.github.com/users/djmattyg007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmattyg007/subscriptions","organizations_url":"https://api.github.com/users/djmattyg007/orgs","repos_url":"https://api.github.com/users/djmattyg007/repos","events_url":"https://api.github.com/users/djmattyg007/events{/privacy}","received_events_url":"https://api.github.com/users/djmattyg007/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/composer/composer/labels/Support","name":"Support","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-02-09T09:25:50Z","updated_at":"2016-02-11T12:07:57Z","closed_at":"2016-02-09T14:41:44Z","body":"If I install a package that requires various other packages, and some of those packages require other packages, etc etc, and then run 'composer remove' to remove the original package I installed, none of its dependencies (that I never specifically required) are removed. There doesn't appear to be any way of keeping track of which packages were installed automatically as dependencies, nor does there appear to be any way of automatically cleaning these up.\r\n\r\nVarious Linux distro package management tools such as [apt-get](https://help.ubuntu.com/community/AptGet/Howto#Removal_commands) and [pacman](https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks#Orphans) do support this kind of functionality if you're looking for example"},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/182829378","html_url":"https://github.com/composer/composer/issues/4895#issuecomment-182829378","issue_url":"https://api.github.com/repos/composer/composer/issues/4895","id":182829378,"user":{"login":"curry684","id":1455673,"avatar_url":"https://avatars.githubusercontent.com/u/1455673?v=3","gravatar_id":"","url":"https://api.github.com/users/curry684","html_url":"https://github.com/curry684","followers_url":"https://api.github.com/users/curry684/followers","following_url":"https://api.github.com/users/curry684/following{/other_user}","gists_url":"https://api.github.com/users/curry684/gists{/gist_id}","starred_url":"https://api.github.com/users/curry684/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curry684/subscriptions","organizations_url":"https://api.github.com/users/curry684/orgs","repos_url":"https://api.github.com/users/curry684/repos","events_url":"https://api.github.com/users/curry684/events{/privacy}","received_events_url":"https://api.github.com/users/curry684/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T12:07:57Z","updated_at":"2016-02-11T12:07:57Z","body":"It's sort of hypothetical, fully agreed. We all know however that during development the IDE autocomplete is leading - if PhpStorm can find the class and auto-insert a `use`, we continue coding without bothering to check why the class is available.\r\n\r\nI'm just arguing the point that **IF** I accidentally break my codebase because I screwed up on using nth-degree dependencies and removed the 1st-degree citizen, I would like to know it 3 minutes after I read a warning on the subject explicitly listing the orphans, not 2 months later during server deployment with no hint where to start. It makes the git rollbacks and the debugging just so much easier.\r\n\r\nPlus, I don't see any valid reason for defaulting **not** to clean them up."}}