{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/44494","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44494/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44494/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44494/events","html_url":"https://github.com/Homebrew/homebrew/pull/44494","id":109304430,"number":44494,"title":"Replace GNU patch with git apply for applying patches","user":{"login":"kausters","id":3408061,"avatar_url":"https://avatars.githubusercontent.com/u/3408061?v=3","gravatar_id":"","url":"https://api.github.com/users/kausters","html_url":"https://github.com/kausters","followers_url":"https://api.github.com/users/kausters/followers","following_url":"https://api.github.com/users/kausters/following{/other_user}","gists_url":"https://api.github.com/users/kausters/gists{/gist_id}","starred_url":"https://api.github.com/users/kausters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kausters/subscriptions","organizations_url":"https://api.github.com/users/kausters/orgs","repos_url":"https://api.github.com/users/kausters/repos","events_url":"https://api.github.com/users/kausters/events{/privacy}","received_events_url":"https://api.github.com/users/kausters/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T13:57:39Z","updated_at":"2015-10-02T07:26:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/44494","html_url":"https://github.com/Homebrew/homebrew/pull/44494","diff_url":"https://github.com/Homebrew/homebrew/pull/44494.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/44494.patch"},"body":"This PR replaces the default patching tool used by Homebrew from GNU patch to Git.\r\n\r\nSince Git is the [preferred tool](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/build.rb#L121) for getting diffs when editing, it would make sense to apply these diffs using Git as well. Additionally, as I read it, the version of GNU patch that comes with OS X (version 2.5.8 as of OS X 10.11) does not fully support the the Git diff format, only supporting \"[most features](http://savannah.gnu.org/forum/forum.php?forum_id=7361)\" of it in version 2.7.\r\n\r\nAs a personal thing, this fixes #44436 by letting me define a symlink as a patch, before the `--interactive phase` of `brew install` kicks in.\r\n\r\nI ran this PR through `brew tests` and it passed, don't know how else to test it apart from real-world usage, where I haven't had any problems. Also I'm not sure whether `ensure_git_installed!` is really necessary."},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/144942542","html_url":"https://github.com/Homebrew/homebrew/pull/44494#issuecomment-144942542","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44494","id":144942542,"user":{"login":"xu-cheng","id":3105373,"avatar_url":"https://avatars.githubusercontent.com/u/3105373?v=3","gravatar_id":"","url":"https://api.github.com/users/xu-cheng","html_url":"https://github.com/xu-cheng","followers_url":"https://api.github.com/users/xu-cheng/followers","following_url":"https://api.github.com/users/xu-cheng/following{/other_user}","gists_url":"https://api.github.com/users/xu-cheng/gists{/gist_id}","starred_url":"https://api.github.com/users/xu-cheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xu-cheng/subscriptions","organizations_url":"https://api.github.com/users/xu-cheng/orgs","repos_url":"https://api.github.com/users/xu-cheng/repos","events_url":"https://api.github.com/users/xu-cheng/events{/privacy}","received_events_url":"https://api.github.com/users/xu-cheng/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T07:26:46Z","updated_at":"2015-10-02T07:26:46Z","body":"Sorry, but we cannot just replace `patch` to `git apply` because it will break patches whose format aren't `git diff`.(e.g. `malbolge` formula)"}}