{"thread":{"id":"52151","subject":"Question - .git subdirectories","startedAt":"2019-10-29T12:26:36Z","lastAt":"2019-11-02T19:14:33Z","messageCount":4,"participants":["Arkadij Chistyj","brian m. carlson","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"385070","messageId":"CABf25VhaqrbtRTpL5ZNRy59o4JSsiKpF3pk3+54sDCkvzdgAmw@mail.gmail.com","threadId":"52151","inReplyTo":null,"subject":"Question - .git subdirectories","fromName":"Arkadij Chistyj","fromEmail":"arkdchst@gmail.com","sentAt":"2019-10-29T12:26:23Z","receivedAt":"2019-10-29T12:26:36Z","isPatch":false,"sender":{"key":"arkdchst@gmail.com","avatar":null},"body":"Hello. I'm not sure it's correctly to write to this email address.\nSorry if it doesn't.\nCopy of my home directory stores on external disk under git control. I\nhave devel/ directory that contains some of my old projects with git\nrepositories. But main git repository in root of disk is not tracking\nand storing their contents. I don't want to use submodules or crutches\nsuch as renaming all .git/ in subdirectories. I just want that git\ntreats my .git/ subdirs as plain dirs with any other names.\nIt was already described here:\nhttps://stackoverflow.com/questions/2317652/nested-git-repositories-without-submodules.\nIt's very simple functionality but I can't find any simple and right solution.\nI just want to know is this possible or not? If not possible, then why?\nThank you in advance.\n"},{"id":"385239","messageId":"20191031202015.u5l3wzvn64zypnad@camp.crustytoothpaste.net","threadId":"52151","inReplyTo":"CABf25VhaqrbtRTpL5ZNRy59o4JSsiKpF3pk3+54sDCkvzdgAmw@mail.gmail.com","subject":"Re: Question - .git subdirectories","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-31T20:20:16Z","receivedAt":"2019-10-31T20:20:23Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-10-29 at 12:26:23, Arkadij Chistyj wrote:\n> Hello. I'm not sure it's correctly to write to this email address.\n> Sorry if it doesn't.\n> Copy of my home directory stores on external disk under git control. I\n> have devel/ directory that contains some of my old projects with git\n> repositories. But main git repository in root of disk is not tracking\n> and storing their contents. I don't want to use submodules or crutches\n> such as renaming all .git/ in subdirectories. I just want that git\n> treats my .git/ subdirs as plain dirs with any other names.\n> It was already described here:\n> https://stackoverflow.com/questions/2317652/nested-git-repositories-without-submodules.\n> It's very simple functionality but I can't find any simple and right solution.\n> I just want to know is this possible or not? If not possible, then why?\n\nThis is not possible.  You can't add a non-bare repository as a part of\na parent repository without using submodules.  Git uses the .git\ndirectory to find the working tree and for safety reasons doesn't allow\nfiles or directories named that to be checked in.  Allowing users to\ncheck in .git directories would allow configuration and hooks to be\nstored as part of the repository, which would allow the execution of\narbitrary code if someone cloned it and then changed into the\nsubrepository.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"385248","messageId":"20191031230106.GB211076@google.com","threadId":"52151","inReplyTo":"CABf25VhaqrbtRTpL5ZNRy59o4JSsiKpF3pk3+54sDCkvzdgAmw@mail.gmail.com","subject":"Re: Question - .git subdirectories","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2019-10-31T23:01:06Z","receivedAt":"2019-10-31T23:01:11Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Arkadij,\n\nArkadij Chistyj wrote:\n>                                               I just want that git\n> treats my .git/ subdirs as plain dirs with any other names.\n[...]\n> It's very simple functionality but I can't find any simple and right solution.\n> I just want to know is this possible or not? If not possible, then why?\n\nTo add to what brian wrote:\n\nThis is one of many things that Git doesn't track:\n\n- empty directories\n- full permissions for files it's tracking\n- owner, group, other attributes\n- resource fork on filesystems that support multiple forks\n\nGit was initially designed to handle source code.  Later, people have\nstarted to use it for tracking other kinds of documents, which has been\nnice.  In general, when push comes to shove, the project has prioritized\nmaking it work well for tracking source code and other documents.\n\nSometimes people find other uses for Git (deployment tool! home\ndirectory tracker! configuration management system!).  It can be\nfun[1]. :)  Ultimately, though, it's useful to keep the main goals of\nGit in mind.\n\nSometimes people want to track a Git repository in another repository\nas a source of test data for tests they include with their code.  For\nthis use, using a \"git fast-export\" stream or other method for\ngenerating a repository at test time can work better, or, if one\nreally must use a repo-in-repo, using a bare repository.  Brian did a\ngood job of describing why.\n\nThanks and hope that helps,\nJonathan\n\n[1] https://public-inbox.org/git/?q=ugfwiini\n"},{"id":"385316","messageId":"CABf25Vhkkd19Tz5E=oVAWUh8nn2A5HW-Od62bNX3LR-gC3vSyA@mail.gmail.com","threadId":"52151","inReplyTo":"20191031230106.GB211076@google.com","subject":"Re: Question - .git subdirectories","fromName":"Arkadij Chistyj","fromEmail":"arkdchst@gmail.com","sentAt":"2019-11-02T19:14:20Z","receivedAt":"2019-11-02T19:14:33Z","isPatch":false,"sender":{"key":"arkdchst@gmail.com","avatar":null},"body":"Thanks you very much for the answer! It was very interesting for me\nand now I can understand why this doesn't work.\nHave a nice weekend.\n"}]}