{"action":"created","issue":{"url":"https://api.github.com/repos/ambv/black/issues/320","repository_url":"https://api.github.com/repos/ambv/black","labels_url":"https://api.github.com/repos/ambv/black/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/ambv/black/issues/320/comments","events_url":"https://api.github.com/repos/ambv/black/issues/320/events","html_url":"https://github.com/ambv/black/issues/320","id":330703990,"node_id":"MDU6SXNzdWUzMzA3MDM5OTA=","number":320,"title":"format SCM diffs only","user":{"login":"gaborbernat","id":690238,"node_id":"MDQ6VXNlcjY5MDIzOA==","avatar_url":"https://avatars1.githubusercontent.com/u/690238?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborbernat","html_url":"https://github.com/gaborbernat","followers_url":"https://api.github.com/users/gaborbernat/followers","following_url":"https://api.github.com/users/gaborbernat/following{/other_user}","gists_url":"https://api.github.com/users/gaborbernat/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborbernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborbernat/subscriptions","organizations_url":"https://api.github.com/users/gaborbernat/orgs","repos_url":"https://api.github.com/users/gaborbernat/repos","events_url":"https://api.github.com/users/gaborbernat/events{/privacy}","received_events_url":"https://api.github.com/users/gaborbernat/received_events","type":"User","site_admin":false},"labels":[{"id":871279155,"node_id":"MDU6TGFiZWw4NzEyNzkxNTU=","url":"https://api.github.com/repos/ambv/black/labels/documentation","name":"documentation","color":"fbcd00","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-08T15:28:42Z","updated_at":"2018-06-09T20:39:08Z","closed_at":null,"author_association":"NONE","body":"Feature request: for projects not fully adopting black yet, would be nice if we could have some way of using black on the diffs only. I understand this is a non-trivial task. But should be possible to somehow get the diff against ``HEAD`` and keep only lines from that. Taking over the world one commit at a time?"},"comment":{"url":"https://api.github.com/repos/ambv/black/issues/comments/395997039","html_url":"https://github.com/ambv/black/issues/320#issuecomment-395997039","issue_url":"https://api.github.com/repos/ambv/black/issues/320","id":395997039,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTk5NzAzOQ==","user":{"login":"ambv","id":55281,"node_id":"MDQ6VXNlcjU1Mjgx","avatar_url":"https://avatars1.githubusercontent.com/u/55281?v=4","gravatar_id":"","url":"https://api.github.com/users/ambv","html_url":"https://github.com/ambv","followers_url":"https://api.github.com/users/ambv/followers","following_url":"https://api.github.com/users/ambv/following{/other_user}","gists_url":"https://api.github.com/users/ambv/gists{/gist_id}","starred_url":"https://api.github.com/users/ambv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambv/subscriptions","organizations_url":"https://api.github.com/users/ambv/orgs","repos_url":"https://api.github.com/users/ambv/repos","events_url":"https://api.github.com/users/ambv/events{/privacy}","received_events_url":"https://api.github.com/users/ambv/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T20:39:08Z","updated_at":"2018-06-09T20:39:08Z","author_association":"OWNER","body":"> It will still damage the usefulness of git history.\r\n\r\nblame != history. It's cleaner to have a single point in history reformatting everything, rather than a sprawling number of diffs that make semantic changes *and* move tokens around to improve style.\r\n\r\nThe easiest way to ignore a sweeping commit with git is `git hyper-blame`. If you don't want to or can't use that, then using `git blame $BLACK_COMMIT^ -- $FILE` is what you want (note the caret). You can easily replicate that in the GUI by clicking on a link to `$BLACK_COMMIT` (will be next to any line that is still blamed to this commit), going one commit up, and looking at blame of the file you're interested in *then*.\r\n\r\nCompare that with looking at the blame of a file that's riddled with commits that change formatting around a semantic change, too. They will necessarily touch unrelated lines immediately around the semantic change, poisoning the visible history without a single revision that you can step over.\r\n\r\n> Rewriting code is inherently dangerous.\r\n\r\nAs Carl says, it's not. I reformatted tens of millions of lines of code with it by now. I could only confidently do this because of the sanity checks that Black performs."}}
{"actor":{"display_login":"ambv"}}