{"action":"created","issue":{"url":"https://api.github.com/repos/git-for-windows/git/issues/174","labels_url":"https://api.github.com/repos/git-for-windows/git/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/git-for-windows/git/issues/174/comments","events_url":"https://api.github.com/repos/git-for-windows/git/issues/174/events","html_url":"https://github.com/git-for-windows/git/pull/174","id":82927142,"number":174,"title":"Fix mergetool p4merge","user":{"login":"calle2010","id":189960,"avatar_url":"https://avatars.githubusercontent.com/u/189960?v=3","gravatar_id":"","url":"https://api.github.com/users/calle2010","html_url":"https://github.com/calle2010","followers_url":"https://api.github.com/users/calle2010/followers","following_url":"https://api.github.com/users/calle2010/following{/other_user}","gists_url":"https://api.github.com/users/calle2010/gists{/gist_id}","starred_url":"https://api.github.com/users/calle2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calle2010/subscriptions","organizations_url":"https://api.github.com/users/calle2010/orgs","repos_url":"https://api.github.com/users/calle2010/repos","events_url":"https://api.github.com/users/calle2010/events{/privacy}","received_events_url":"https://api.github.com/users/calle2010/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/git-for-windows/git/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/git-for-windows/git/labels/git","name":"git","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-30T22:08:46Z","updated_at":"2015-06-14T12:57:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/git-for-windows/git/pulls/174","html_url":"https://github.com/git-for-windows/git/pull/174","diff_url":"https://github.com/git-for-windows/git/pull/174.diff","patch_url":"https://github.com/git-for-windows/git/pull/174.patch"},"body":"The merge tool p4merge fails in certain cases when there is no base version for a 3-way merge. In this case `create_virtual_base` is called to create a base file which contains only the common content of the files to be merged. This base file is presented in p4merge.\r\n\r\nWith this script https://gist.github.com/calle2010/b4910e9b8f0dbbf58fb6 I can replicate the issues in a repository with core.autocrlf=true.\r\n\r\nThere are two issues:\r\n\r\n1. Since commit c536c07 git-apply fails with *invalid path* if the path starts with a dot.\r\n2. If the files have CRLF line endings these will be included in the output of `diff`. This leads to error messages about trailing whitespace in git-apply.\r\n\r\nEven though the patch resolves the issues I have some doubts about this patch:\r\n* Is the parameter expansion with # allowed in a Git bash script?\r\n* `create_virtual_base` seems to be used by mergetools/p4merge and git-merge-one-file.sh only. The latter is described as an sample script in the documentation of [git-merge-index](https://github.com/git/git/blob/398dd4bd039680ba98497fbedffa415a43583c16/Documentation/git-merge-index.txt#L47-L48). So I hope I'm not in the risk of breaking anything very central here."},"comment":{"url":"https://api.github.com/repos/git-for-windows/git/issues/comments/111824674","html_url":"https://github.com/git-for-windows/git/pull/174#issuecomment-111824674","issue_url":"https://api.github.com/repos/git-for-windows/git/issues/174","id":111824674,"user":{"login":"calle2010","id":189960,"avatar_url":"https://avatars.githubusercontent.com/u/189960?v=3","gravatar_id":"","url":"https://api.github.com/users/calle2010","html_url":"https://github.com/calle2010","followers_url":"https://api.github.com/users/calle2010/followers","following_url":"https://api.github.com/users/calle2010/following{/other_user}","gists_url":"https://api.github.com/users/calle2010/gists{/gist_id}","starred_url":"https://api.github.com/users/calle2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calle2010/subscriptions","organizations_url":"https://api.github.com/users/calle2010/orgs","repos_url":"https://api.github.com/users/calle2010/repos","events_url":"https://api.github.com/users/calle2010/events{/privacy}","received_events_url":"https://api.github.com/users/calle2010/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T12:57:02Z","updated_at":"2015-06-14T12:57:02Z","body":"So I found a solution to the last issue, but there is still some to do:\r\n\r\n * support --label for the sake of compatibility?\r\n * documentation\r\n * tests\r\n * run test suite\r\n"}}