{"thread":{"id":"41900","subject":"Masking or hiding directories and files during a git submodule checkout","startedAt":"2016-04-01T11:56:46Z","lastAt":"2016-04-01T11:56:46Z","messageCount":1,"participants":["Peter Waller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"282451","messageId":"56FE61FE.2020700@pwaller.net","threadId":"41900","inReplyTo":null,"subject":"Masking or hiding directories and files during a git submodule checkout","fromName":"Peter Waller","fromEmail":"p@pwaller.net","sentAt":"2016-04-01T11:56:46Z","receivedAt":"2016-04-01T11:56:46Z","isPatch":false,"sender":{"key":"p@pwaller.net","avatar":null},"body":"Hi All,\n\nMy constraints are as follows:\n\n* I use submodules to reference other people's code.\n* I don't like to have to send commits to those authors of those \nsubmodules, they might not be accepted.\n* I don't want to maintain my own fork of the submodule.\n* Some submodules may contain lots of stuff I don't want to check out.\n* I want other people (and existing tooling, such as `go get`) to be \nable to do an ordinary git clone --recursive and not get specific \ndirectories within some submodules checked not.\n\nIn my specific use case, I have:\n\n/myfile\n/submodule1/directory/nestedsubmodule2\n\nThat is, submodule1 itself uses submodules and contains a directory with \nnestedsubmodule2.\n\nWhat I would like to achieve is to be able to specify in my repository \nconfiguration that I don't want anything living in \n/submodule1/directory/ to be checked out. But I want to check out \neverything else as normal.\n\nIdeally, this would happen automatically during a git clone --recursive, \nprobably by being specified somewhere such as .gitattributes. I envisage \nit this way so that it would work automatically with existing tooling.\n\n* Is this possible now via any means?\n\n* Is this against some fundamental philosophy?\n\n* Is it conceivable that patches would be accepted to make this happen?\n\nThanks,\n\n- Peter\n\nFor further information, this is a follow on from a mega-thread about \nvendoring packages in go [*]. I'm seeking a minimal solution where \nlittle additional tooling is required, and this is just one avenue I'm \npursuing. One such solution (considered in this email) could be to avoid \nchecking out specific directories which live in submodules. Of course if \nit requires changes to git, I'd have to wait for it to update before I \ncan use that feature, but I'm OK with that, so long as we have a \nsolution which works eventually.\n\n[*] https://groups.google.com/d/topic/golang-nuts/AnMr9NL6dtc/discussion\n"}]}