{"action":"created","issue":{"url":"https://api.github.com/repos/audreyr/cookiecutter/issues/694","repository_url":"https://api.github.com/repos/audreyr/cookiecutter","labels_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/694/labels{/name}","comments_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/694/comments","events_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/694/events","html_url":"https://github.com/audreyr/cookiecutter/pull/694","id":152901230,"number":694,"title":"WIP - Hooks enhancement: running real file in place + context serialization ","user":{"login":"eviweb","id":1310382,"avatar_url":"https://avatars.githubusercontent.com/u/1310382?v=3","gravatar_id":"","url":"https://api.github.com/users/eviweb","html_url":"https://github.com/eviweb","followers_url":"https://api.github.com/users/eviweb/followers","following_url":"https://api.github.com/users/eviweb/following{/other_user}","gists_url":"https://api.github.com/users/eviweb/gists{/gist_id}","starred_url":"https://api.github.com/users/eviweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eviweb/subscriptions","organizations_url":"https://api.github.com/users/eviweb/orgs","repos_url":"https://api.github.com/users/eviweb/repos","events_url":"https://api.github.com/users/eviweb/events{/privacy}","received_events_url":"https://api.github.com/users/eviweb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/audreyr/cookiecutter/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2016-05-03T23:56:07Z","updated_at":"2016-06-11T12:46:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/694","html_url":"https://github.com/audreyr/cookiecutter/pull/694","diff_url":"https://github.com/audreyr/cookiecutter/pull/694.diff","patch_url":"https://github.com/audreyr/cookiecutter/pull/694.patch"},"body":"hi,\r\nhere is an enhancement of how hooks work.\r\nThey now receive through the standard input stream, the cookiecutter context object, serialized in JSON .\r\nThis allows to unserialize this object, and then simply read and/or update some values that can be sent back to the main context, by writing a JSON serialized object to the standard output.     \r\n\r\nIt is also possible to disable the hook duplication by adding the setting `\"_no_hookcopy\": \"yes\"` in the `cookiecutter.json`. Hooks are then run directly in place. \r\nThis should be useful, when a template author does not need to use template variables directly in his/her hooks and want to keep track of the template directory.\r\nA concrete example is license management. In the documentation - [Choice Variables (1.1+)](https://cookiecutter.readthedocs.io/en/latest/advanced_usage.html#choice-variables-1-1) - it is explained how to manage licenses in one file.\r\nIt should be easier to get many license file templates in a directory, and then just copy the selected one.\r\nMore information and examples are available in the updated `Advanced usage` page of the documentation of this PR.\r\nThis is the start of a proposition and I'm very interesting by getting some feedbacks.\r\n\r\nBest regards\r\n\r\nEric\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/audreyr/cookiecutter/issues/comments/225359186","html_url":"https://github.com/audreyr/cookiecutter/pull/694#issuecomment-225359186","issue_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/694","id":225359186,"user":{"login":"michaeljoseph","id":169933,"avatar_url":"https://avatars.githubusercontent.com/u/169933?v=3","gravatar_id":"","url":"https://api.github.com/users/michaeljoseph","html_url":"https://github.com/michaeljoseph","followers_url":"https://api.github.com/users/michaeljoseph/followers","following_url":"https://api.github.com/users/michaeljoseph/following{/other_user}","gists_url":"https://api.github.com/users/michaeljoseph/gists{/gist_id}","starred_url":"https://api.github.com/users/michaeljoseph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaeljoseph/subscriptions","organizations_url":"https://api.github.com/users/michaeljoseph/orgs","repos_url":"https://api.github.com/users/michaeljoseph/repos","events_url":"https://api.github.com/users/michaeljoseph/events{/privacy}","received_events_url":"https://api.github.com/users/michaeljoseph/received_events","type":"User","site_admin":false},"created_at":"2016-06-11T12:46:34Z","updated_at":"2016-06-11T12:46:34Z","body":"Hi @eviweb 😄 \r\n\r\nThanks for all this code- it's an impressive amount of work!\r\nHowever, I think it's unlikely for this PR to get accepted in it's current form _because_ it's making so many changes- this makes it daunting and time-consuming for us to review.\r\nSo I'd suggest breaking this up into multiple pieces of work and re-submitting:\r\n- the running hooks in place functionality was pretty much ready to go\r\n- I like the idea of the `pre_user_prompt` hook\r\n- the context serialisation work is quite complicated- the original approach of passing `json` to the hooks on `stdin` would be more appropriate I think.\r\n\r\nThanks again and please keep contributing 😸 "}}
{"actor":{"display_login":"michaeljoseph"}}