{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10873","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10873/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10873/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10873/events","html_url":"https://github.com/NixOS/nixpkgs/issues/10873","id":115689454,"number":10873,"title":"fetchgitLocal uses an incorrect way to get the git directory","user":{"login":"ftrvxmtrx","id":248148,"avatar_url":"https://avatars.githubusercontent.com/u/248148?v=3","gravatar_id":"","url":"https://api.github.com/users/ftrvxmtrx","html_url":"https://github.com/ftrvxmtrx","followers_url":"https://api.github.com/users/ftrvxmtrx/followers","following_url":"https://api.github.com/users/ftrvxmtrx/following{/other_user}","gists_url":"https://api.github.com/users/ftrvxmtrx/gists{/gist_id}","starred_url":"https://api.github.com/users/ftrvxmtrx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftrvxmtrx/subscriptions","organizations_url":"https://api.github.com/users/ftrvxmtrx/orgs","repos_url":"https://api.github.com/users/ftrvxmtrx/repos","events_url":"https://api.github.com/users/ftrvxmtrx/events{/privacy}","received_events_url":"https://api.github.com/users/ftrvxmtrx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-07T20:18:31Z","updated_at":"2015-11-07T22:35:54Z","closed_at":null,"body":"https://github.com/NixOS/nixpkgs/commit/72660409f5b27f095ee1a355e0577bc406d914b0#diff-c7bec12494f11831828500ff286831d8R13\r\n\r\nThe `ROOT=...` logic *should* work for most of the repos, but not for submodules, which have `.git` as a file with a `gitdir` parameter pointing somewhere else.\r\nI propose to change the above logic to something like:\r\n```\r\ngitdir=$(git rev-parse --git-dir)\r\n\r\ncp $gitdir/index $gitdir/index-user\r\n...\r\n```\r\n\r\nThe other problem is that it's *still* not enough to make `nix-build -A my-subpackage` work again, for example:\r\n```\r\ncp: cannot create regular file '/home/..../.git/modules/my-submodule/index-user': Permission denied\r\n```\r\n\r\nUntil this is fixed I have to put an old version of `fetchgitLocal` into my projects with submodules as Nix packages."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/154758672","html_url":"https://github.com/NixOS/nixpkgs/issues/10873#issuecomment-154758672","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10873","id":154758672,"user":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars.githubusercontent.com/u/1055245?v=3","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"created_at":"2015-11-07T22:35:54Z","updated_at":"2015-11-07T22:35:54Z","body":"https://github.com/Ericson2314/nixpkgs/commit/0e3a503f262fd8269efc265edff15db93859bb3e\r\n\r\nI got to go, if you could test this that would be great"}}