{"action":"created","issue":{"url":"https://api.github.com/repos/golang/dep/issues/625","repository_url":"https://api.github.com/repos/golang/dep","labels_url":"https://api.github.com/repos/golang/dep/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/golang/dep/issues/625/comments","events_url":"https://api.github.com/repos/golang/dep/issues/625/events","html_url":"https://github.com/golang/dep/issues/625","id":230589957,"number":625,"title":"Vendor only the used packages in a dependency repository","user":{"login":"ahmetb","id":159209,"avatar_url":"https://avatars1.githubusercontent.com/u/159209?v=4","gravatar_id":"","url":"https://api.github.com/users/ahmetb","html_url":"https://github.com/ahmetb","followers_url":"https://api.github.com/users/ahmetb/followers","following_url":"https://api.github.com/users/ahmetb/following{/other_user}","gists_url":"https://api.github.com/users/ahmetb/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetb/subscriptions","organizations_url":"https://api.github.com/users/ahmetb/orgs","repos_url":"https://api.github.com/users/ahmetb/repos","events_url":"https://api.github.com/users/ahmetb/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-23T05:19:26Z","updated_at":"2018-02-07T11:19:25Z","closed_at":"2017-05-23T14:21:47Z","author_association":"CONTRIBUTOR","body":"I am trying to figure out how can I make sure I only vendor a particular package from a huge repository my project depends on.\r\n\r\nFor example consider this simple program with `main.go` and nothing else:\r\n\r\n```go\r\npackage main\r\n\r\nimport \"google.golang.org/api/cloudbuild/v1\"\r\n\r\nfunc main() {\r\n    _ = v1.CloudPlatformScope\r\n}\r\n```\r\n\r\nI then run `dep init` on this directory to initialize Gopkg files. This simple dependency yields in **2,129,065** lines of code to be vendored. Is this by design?\r\n\r\nIf I use `govendor`/`godep` this is not the case as those tools can figure out what packages are used in the build and vendor only those. Am I doing something wrong?"},"comment":{"url":"https://api.github.com/repos/golang/dep/issues/comments/363738687","html_url":"https://github.com/golang/dep/issues/625#issuecomment-363738687","issue_url":"https://api.github.com/repos/golang/dep/issues/625","id":363738687,"user":{"login":"leonid-shevtsov","id":116518,"avatar_url":"https://avatars2.githubusercontent.com/u/116518?v=4","gravatar_id":"","url":"https://api.github.com/users/leonid-shevtsov","html_url":"https://github.com/leonid-shevtsov","followers_url":"https://api.github.com/users/leonid-shevtsov/followers","following_url":"https://api.github.com/users/leonid-shevtsov/following{/other_user}","gists_url":"https://api.github.com/users/leonid-shevtsov/gists{/gist_id}","starred_url":"https://api.github.com/users/leonid-shevtsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonid-shevtsov/subscriptions","organizations_url":"https://api.github.com/users/leonid-shevtsov/orgs","repos_url":"https://api.github.com/users/leonid-shevtsov/repos","events_url":"https://api.github.com/users/leonid-shevtsov/events{/privacy}","received_events_url":"https://api.github.com/users/leonid-shevtsov/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T11:19:25Z","updated_at":"2018-02-07T11:19:25Z","author_association":"NONE","body":"The gitignore snippet from @VojtechVitek wouldn't work in my case - and probably most cases - because the first line will ignore all directories under `vendor`, and per [Git documentation](https://git-scm.com/docs/gitignore)\r\n\r\n>It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. \r\n\r\n(Spent some time figuring out why wouldn't Git see _anything_ inside my vendor directory.)"}}
{"actor":{"display_login":"leonid-shevtsov"}}