{"thread":{"id":"39850","subject":"git on vagrant shared folder","startedAt":"2015-07-14T15:49:43Z","lastAt":"2015-07-20T07:26:46Z","messageCount":6,"participants":["Peter Hüfner","Fredrik Gustafsson","Stefan Beller","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"266130","messageId":"7C05ACF4-6536-4E60-BC92-FF7F0E266C0D@e-confirm.de","threadId":"39850","inReplyTo":null,"subject":"git on vagrant shared folder","fromName":"Peter Hüfner","fromEmail":"p.huefner@e-confirm.de","sentAt":"2015-07-14T15:49:43Z","receivedAt":"2015-07-14T15:49:43Z","isPatch":false,"sender":{"key":"p.huefner@e-confirm.de","avatar":null},"body":"Dear git-Team,\nwe recognized a behavior that comes up with a newer git version. Unfortunately we do not know which version exactly.\n\nThe problem:\nFor development we are using virtual box controlled via vagrant with a shared folder on windows and mac hosts. The virtual OS ist ubuntu 14.04.2 LTS. In march this year we started with git in version around 2.3. With cloning a repo directly in the shared folder we haven’t had any problems.\nA few weeks ago we weren’t able to clone and get an error: could not commit /vagrant/.git/config file. Manually we were able to change that file and also the clone command works outside the shared folder.\n\nWe retried it again with git version 1.9.1 (I think the standard of ubuntu 14.04 LTS) and it worked. So the break seems to be around 2.4.\n\nI hope you are able to understand the problem and can do something. Please tell me if this is not a real bug.\n\nThanks a lot for the greatest VCS in the world.\n\nGreetings from Berlin.\n\nMit freundlichen Grüßen\n \nPeter Hüfner\n.........................................................\ne·confirm GmbH ..\nTravel.Software.Training.Consulting\n \nGeschäftsführer: Roman Borch und Michael Posthoff\nHRB 35653B   Steuernummer 37/211/10880\n10119 Berlin Linienstr. 214\n \nTel.  +49 (0) 30 28 00 28 24 \nFax. +49 (0) 30 28 00 28 28\n \nwww.e-confirm.de\n.................................................................................................\n"},{"id":"266137","messageId":"20150714183215.GG7613@paksenarrion.iveqy.com","threadId":"39850","inReplyTo":"7C05ACF4-6536-4E60-BC92-FF7F0E266C0D@e-confirm.de","subject":"Re: git on vagrant shared folder","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2015-07-14T18:32:15Z","receivedAt":"2015-07-14T18:32:15Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"Hi,\nI don't know if this helps you, but I found two strange things with your\nhistory that I want to point out.\n\nOn Tue, Jul 14, 2015 at 05:49:43PM +0200, Peter Hüfner wrote:\n> The problem:\n> For development we are using virtual box controlled via vagrant with a shared folder on windows and mac hosts. The virtual OS ist ubuntu 14.04.2 LTS. In march this year we started with git in version around 2.3. With cloning a repo directly in the shared folder we haven’t had any problems.\n\nSo you're running git on windows/os x and store the files on a shared\nfolder on Ubuntu? This will have some strange side effects.\nSynchronization errors with the shared folder and the different file\nsystems used might cause a problem (or might not). This is a unusual\nusecase and _very complex_ use case. I wouldn't be surprised if it\nbreaks (git have had several bugs on shared folders before).\n\nMy advise is to run git on the same machine as you store the git repo\non. Git should not be runned over a network (no matter if the network is\nlocal on your computer or not).\n\n\n> A few weeks ago we weren’t able to clone and get an error: could not commit /vagrant/.git/config file. Manually we were able to change that file and also the clone command works outside the shared folder.\n\nWhy are you trying to commit a file inside the .git dir? Files in that\ndir should not be commited (and I'm pretty sure there was a patch about\nthis a while ago). The .git/config file for example is local to each git\nrepo and should not be commited.\n-- \nFredrik Gustafsson\n\nphone: +46 733-608274\ne-mail: iveqy@iveqy.com\nwebsite: http://www.iveqy.com\n"},{"id":"266138","messageId":"CAGZ79kbBKzbjbg5u7A7BgnV1JF=5A+-gb0OdYs11g6kx_UQu_A@mail.gmail.com","threadId":"39850","inReplyTo":"20150714183215.GG7613@paksenarrion.iveqy.com","subject":"Re: git on vagrant shared folder","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-07-14T18:53:52Z","receivedAt":"2015-07-14T18:53:52Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":">\n>> A few weeks ago we weren’t able to clone and get an error: could not commit /vagrant/.git/config file. Manually we were able to change that file and also the clone command works outside the shared folder.\n>\n> Why are you trying to commit a file inside the .git dir? Files in that\n> dir should not be commited (and I'm pretty sure there was a patch about\n> this a while ago). The .git/config file for example is local to each git\n> repo and should not be commited.\n\nActually it is considered a security risk, see\nhttp://article.gmane.org/gmane.linux.kernel/1853266\n"},{"id":"266173","messageId":"ABFD6E6C-A59B-49FB-8B39-D86F00EA2A8D@e-confirm.de","threadId":"39850","inReplyTo":"CAGZ79kbBKzbjbg5u7A7BgnV1JF=5A+-gb0OdYs11g6kx_UQu_A@mail.gmail.com","subject":"Re: git on vagrant shared folder","fromName":"Peter Hüfner","fromEmail":"p.huefner@e-confirm.de","sentAt":"2015-07-16T07:09:33Z","receivedAt":"2015-07-16T07:09:33Z","isPatch":false,"sender":{"key":"p.huefner@e-confirm.de","avatar":null},"body":"Hi Stefan, Hi Frederik,\n\nmaybe I stated the case not clearly enough.\n\nThe repo is just inside an shared/mounted folder from the VM to the Host, so that we can access the sourcecode via an IDE running on the host. The git commands are executed inside the VM on an ubuntu system. So there is no mix of operating systems in the repos directly. The shared/mounted folder is underlying some restrictions, such as no filemode and case insensitive filenames. But with git we can handle this.\n\nWe do not commit any file inside the .git folder. The error (could not commit .git/config file) comes up while the git-clone command executed inside the shared folder.\n\nI tried to clone the repo outside the shared folder and copied it inside afterwards. As I was doing the configuration for filemode and case with the git-config command, I got the same error (could not commit .git/config file). But I was able to update the .git/config manually. So it is not only an access problem, because I can access the file.\n\nThe security risk is stated with version 2.2.1, but we were able clone in the shared folder with git 2.3. So the change must be in an higher version.\n\nMaybe I am able to install a few versions of git and try the scenario for them, then i should be able to determine the version explicit.\n\nThanks again for your help. I hope I could state the problem a bit more detailed for you.\n\n\nMit freundlichen Grüßen\n \nPeter Hüfner\n.........................................................\ne·confirm GmbH ..\nTravel.Software.Training.Consulting\n \nGeschäftsführer: Roman Borch und Michael Posthoff\nHRB 35653B   Steuernummer 37/211/10880\n10119 Berlin Linienstr. 214\n \nTel.  +49 (0) 30 28 00 28 24 \nFax. +49 (0) 30 28 00 28 28\n \nwww.e-confirm.de\n.................................................................................................\n\n> Am 14.07.2015 um 20:53 schrieb Stefan Beller <sbeller@google.com>:\n> \n>> \n>>> A few weeks ago we weren’t able to clone and get an error: could not commit /vagrant/.git/config file. Manually we were able to change that file and also the clone command works outside the shared folder.\n>> \n>> Why are you trying to commit a file inside the .git dir? Files in that\n>> dir should not be commited (and I'm pretty sure there was a patch about\n>> this a while ago). The .git/config file for example is local to each git\n>> repo and should not be commited.\n> \n> Actually it is considered a security risk, see\n> http://article.gmane.org/gmane.linux.kernel/1853266\n"},{"id":"266197","messageId":"xmqq7fq05a2v.fsf@gitster.dls.corp.google.com","threadId":"39850","inReplyTo":"CAGZ79kbBKzbjbg5u7A7BgnV1JF=5A+-gb0OdYs11g6kx_UQu_A@mail.gmail.com","subject":"Re: git on vagrant shared folder","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-16T16:41:28Z","receivedAt":"2015-07-16T16:41:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n>>> A few weeks ago we weren’t able to clone and get an error: could\n>> not commit /vagrant/.git/config file. Manually we were able to\n>> change that file and also the clone command works outside the shared\n>> folder.\n>>\n>> Why are you trying to commit a file inside the .git dir? Files in that\n>> dir should not be commited (and I'm pretty sure there was a patch about\n>> this a while ago). The .git/config file for example is local to each git\n>> repo and should not be commited.\n>\n> Actually it is considered a security risk, see\n> http://article.gmane.org/gmane.linux.kernel/1853266\n\nI do not think Peter meant to \"git add .git/config && git commit\" by\nreferring to the 'could not commit config file' error message he\nsaw; you two are going in a wrong direction.\n\n    $ git grep 'could not commit'\n    config.c: error(\"could not commit config file %s\", config_filename);\n\nI do share Fredrik's suspicion that the virtual filesystem the\nUbuntu guest is trying to write to is at fault, but I never used\n\"vagrant shared\", and I do not know in what specific way their\nfilesystem is not behaving as we expect.\n\nApplying 7a64592c (config.c: fix writing config files on Windows\nnetwork shares, 2015-06-30) might be an interesting thing to try.\nSome filesystems do not want to rename a file that has mmaped region\nstill active, which is my blind guess.\n"},{"id":"266483","messageId":"CD7F4720-BC1F-4382-9EF7-00E7F3A5C60C@e-confirm.de","threadId":"39850","inReplyTo":"xmqq7fq05a2v.fsf@gitster.dls.corp.google.com","subject":"Re: git on vagrant shared folder","fromName":"Peter Hüfner","fromEmail":"p.huefner@e-confirm.de","sentAt":"2015-07-20T07:26:46Z","receivedAt":"2015-07-20T07:26:46Z","isPatch":false,"sender":{"key":"p.huefner@e-confirm.de","avatar":null},"body":"Junio is absolutely right. I wasn’t trying to commit that file directly. The error comes up when I want to change the config via git config or when I clone the repo.\nI also know that a shared folder is not a very friendly environment, but it is the best solution for our situation here.\nWe recognized the error first time in the beginning of july, so the change done in june 30 seems to be a reason.\nI will stay up to date and try it with newer git versions.\n\n\nMit freundlichen Grüßen\n \nPeter Hüfner\n.........................................................\ne·confirm GmbH ..\nTravel.Software.Training.Consulting\n \nGeschäftsführer: Roman Borch und Michael Posthoff\nHRB 35653B   Steuernummer 37/211/10880\n10119 Berlin Linienstr. 214\n \nTel.  +49 (0) 30 28 00 28 24 \nFax. +49 (0) 30 28 00 28 28\n \nwww.e-confirm.de\n.................................................................................................\n\n> Am 16.07.2015 um 18:41 schrieb Junio C Hamano <gitster@pobox.com>:\n> \n> Stefan Beller <sbeller@google.com> writes:\n> \n>>>> A few weeks ago we weren’t able to clone and get an error: could\n>>> not commit /vagrant/.git/config file. Manually we were able to\n>>> change that file and also the clone command works outside the shared\n>>> folder.\n>>> \n>>> Why are you trying to commit a file inside the .git dir? Files in that\n>>> dir should not be commited (and I'm pretty sure there was a patch about\n>>> this a while ago). The .git/config file for example is local to each git\n>>> repo and should not be commited.\n>> \n>> Actually it is considered a security risk, see\n>> http://article.gmane.org/gmane.linux.kernel/1853266\n> \n> I do not think Peter meant to \"git add .git/config && git commit\" by\n> referring to the 'could not commit config file' error message he\n> saw; you two are going in a wrong direction.\n> \n>    $ git grep 'could not commit'\n>    config.c: error(\"could not commit config file %s\", config_filename);\n> \n> I do share Fredrik's suspicion that the virtual filesystem the\n> Ubuntu guest is trying to write to is at fault, but I never used\n> \"vagrant shared\", and I do not know in what specific way their\n> filesystem is not behaving as we expect.\n> \n> Applying 7a64592c (config.c: fix writing config files on Windows\n> network shares, 2015-06-30) might be an interesting thing to try.\n> Some filesystems do not want to rename a file that has mmaped region\n> still active, which is my blind guess.\n> \n"}]}