{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew-bundle/issues/322","repository_url":"https://api.github.com/repos/Homebrew/homebrew-bundle","labels_url":"https://api.github.com/repos/Homebrew/homebrew-bundle/issues/322/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew-bundle/issues/322/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew-bundle/issues/322/events","html_url":"https://github.com/Homebrew/homebrew-bundle/issues/322","id":294631425,"number":322,"title":"Optionally output package description as comment","user":{"login":"colindean","id":197224,"avatar_url":"https://avatars1.githubusercontent.com/u/197224?v=4","gravatar_id":"","url":"https://api.github.com/users/colindean","html_url":"https://github.com/colindean","followers_url":"https://api.github.com/users/colindean/followers","following_url":"https://api.github.com/users/colindean/following{/other_user}","gists_url":"https://api.github.com/users/colindean/gists{/gist_id}","starred_url":"https://api.github.com/users/colindean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colindean/subscriptions","organizations_url":"https://api.github.com/users/colindean/orgs","repos_url":"https://api.github.com/users/colindean/repos","events_url":"https://api.github.com/users/colindean/events{/privacy}","received_events_url":"https://api.github.com/users/colindean/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-02-06T04:49:00Z","updated_at":"2018-02-07T04:32:36Z","closed_at":"2018-02-06T10:39:08Z","author_association":"CONTRIBUTOR","body":"I'd like to have a Brewfile that has only the formulae that I've intended to install, no dependencies. Since Homebrew doesn't seem to track† if a formula was installed manually or as a dependency, I'm left to manually edit the output of `brew bundle dump`. It's a slog because I've got more than 350 packages installed but I'll deal.\r\n\r\nWhat could really expedite my discovery of what some formulae are is including as a comment on the line or above it in the Brewfile output. That way, I don't have to do `brew info packagename` for every package I don't recognize, which is a lot since my Homebrew installation dates back a few years. Honestly, I've found that every Brewfile I've manually created for the last couple of months – something I've been dropping into every repo I touch at work – has had a comment describing what the package is or does.\r\n\r\nI'm willing to put the time into developing this feature. I envision it as an addition [here](https://github.com/Homebrew/homebrew-bundle/blob/master/lib/bundle/brew_dumper.rb#L123)\r\n and [here](https://github.com/Homebrew/homebrew-bundle/blob/master/lib/bundle/brew_dumper.rb#L32). It would be enabled through a command line option to the `dump` command, probably something like `--comment` or `--describe`. There's some complexity in that it appears that there are not currently arguments passed down into the dumper.\r\n\r\n_† One thing I noted is that maybe this assumption is out of date, given what I see [here](https://github.com/Homebrew/homebrew-bundle/blob/master/lib/bundle/brew_dumper.rb#L25): `f[:installed_on_request?] || !f[:installed_as_dependency?]`_"},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew-bundle/issues/comments/363654406","html_url":"https://github.com/Homebrew/homebrew-bundle/issues/322#issuecomment-363654406","issue_url":"https://api.github.com/repos/Homebrew/homebrew-bundle/issues/322","id":363654406,"user":{"login":"colindean","id":197224,"avatar_url":"https://avatars1.githubusercontent.com/u/197224?v=4","gravatar_id":"","url":"https://api.github.com/users/colindean","html_url":"https://github.com/colindean","followers_url":"https://api.github.com/users/colindean/followers","following_url":"https://api.github.com/users/colindean/following{/other_user}","gists_url":"https://api.github.com/users/colindean/gists{/gist_id}","starred_url":"https://api.github.com/users/colindean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colindean/subscriptions","organizations_url":"https://api.github.com/users/colindean/orgs","repos_url":"https://api.github.com/users/colindean/repos","events_url":"https://api.github.com/users/colindean/events{/privacy}","received_events_url":"https://api.github.com/users/colindean/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T04:32:36Z","updated_at":"2018-02-07T04:32:36Z","author_association":"CONTRIBUTOR","body":"I've implemented `--describe` a lot faster than I thought I would be able to! It's just a little less useful than I thought it would be: turns out casks don't have a description, only a name; taps don't have information about them other than their name, and `mas` output has just a name. At least I've saved some typing! The tests though… I'm out of rspec practice.\r\n\r\nI started plotting out how `brew bundle list` might work. I think I could create a class `Bundle::ListDsl` that overrides the behavior of `Bundle::Dsl#install` to output each entry name instead of installing it. A set of options would output only the dependency type specified: \r\n\r\n    brew bundle list         # outputs everything, kinda messy because we lose dependency type info?\r\n    brew bundle list --brews\r\n    brew bundle list --casks\r\n    brew bundle list --taps\r\n    brew bundle list --mas\r\n    brew bundle list --all   # could alternatively output just Homebrew formulae for the bare command…\r\n\r\nAnother way to do it would be to refactor `Bundle::Dsl` a bit. Move `Bundle::Dsl#install` to another class, perhaps `Bundle::Installer` to mirror the dumpers structure. This leaves the DSL parsing code in place and lets an instance of `Bundle::Dsl` really be a collection of entries: consumers of it would just act on its `entries`.\r\n\r\nThoughts?"}}
{"actor":{"display_login":"colindean"}}