{"thread":{"id":"46705","subject":"Empty directories in Git: Current guidance for historical commits?","startedAt":"2017-09-05T14:47:05Z","lastAt":"2017-09-06T00:18:45Z","messageCount":4,"participants":["wafflecode@openmail.cc","Torsten Bögershausen","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"327581","messageId":"20170905124743.Horde.bgYg8gUhE6ubSHtPAr3lCGl@vfemail.net","threadId":"46705","inReplyTo":null,"subject":"Empty directories in Git: Current guidance for historical commits?","fromName":"","fromEmail":"wafflecode@openmail.cc","sentAt":"2017-09-05T12:47:43Z","receivedAt":"2017-09-05T14:47:05Z","isPatch":false,"sender":{"key":"wafflecode@openmail.cc","avatar":null},"body":"\nHello,\n\nPer the FAQ it's clear that Git (by current design) does not track  \nempty directories:   \nhttps://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F\n\nThat's fine and I can fix that for my code going forward via the build  \nsystem, as needed.\n\nHowever I'm looking to import a fairly deep (10k+ commits) svn history  \nin to Git and I'm wondering what the current best practices are for  \ndealing with empty folders?   Meaning to say, I'd like to be able to  \ncheck out an older revision of the code and have it build correctly  \nusing the older build system which expects certain folders to exist.\n\nThere are a few different answers floating around the net, so I  \nfigured I'd confirm via the mailing list.\n\nIs just dropping a \".gitignore\" or \"README\" file in the empty  \ndirectories during conversion still the most reasonable approach?  If  \nso, is there a way to do this automatically during the conversion  \nusing \"git svn\" or the like?\n\n\nThank you\nDavid\n\n\n\n-------------------------------------------------\n\nONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!\n$24.95 ONETIME Lifetime accounts with Privacy Features!  \n15GB disk! No bandwidth quotas!\nCommercial and Bulk Mail Options!  \n"},{"id":"327595","messageId":"f8ed8f0b-a2e1-9e7a-bf79-2b7629b838f2@web.de","threadId":"46705","inReplyTo":"20170905124743.Horde.bgYg8gUhE6ubSHtPAr3lCGl@vfemail.net","subject":"Re: Empty directories in Git: Current guidance for historical commits?","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-09-05T17:58:07Z","receivedAt":"2017-09-05T17:58:22Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2017-09-05 14:47, wafflecode@openmail.cc wrote:\n> \n> Hello,\n> \n> Per the FAQ it's clear that Git (by current design) does not track empty\n> directories: \n> https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F\n> \n> That's fine and I can fix that for my code going forward via the build system,\n> as needed.\n> \n> However I'm looking to import a fairly deep (10k+ commits) svn history in to Git\n> and I'm wondering what the current best practices are for dealing with empty\n> folders?   Meaning to say, I'd like to be able to check out an older revision of\n> the code and have it build correctly using the older build system which expects\n> certain folders to exist.\n> \n> There are a few different answers floating around the net, so I figured I'd\n> confirm via the mailing list.\n> \n> Is just dropping a \".gitignore\" or \"README\" file in the empty directories during\n> conversion still the most reasonable approach? \n\nA .gitignore will, but may cost 0.001% CPU time when running \"git status\".\nI have seen systems that create a file called \".empty\" in every directory.\n\n> If so, is there a way to do this\n> automatically during the conversion using \"git svn\" or the like?\n\nNot what I am aware of.\nAnd even if, the .empty files need to be removed, once the directory is\nremoved.\nAnd we don't have logic for that, as far as I know.\n\nThat would be by suggestion:\nconvert the repo \"as is\", with the tools we have.\n\nIf you need to continue to work on an old branch (or the master branch),\nadd the .empty file, where needed, and continue to work in Git, on\na branch as usual.\n\n\n> \n> \n> Thank you\n> David\n>\n"},{"id":"327600","messageId":"20170905203130.fgleyt7josyjnps7@sigill.intra.peff.net","threadId":"46705","inReplyTo":"20170905124743.Horde.bgYg8gUhE6ubSHtPAr3lCGl@vfemail.net","subject":"Re: Empty directories in Git: Current guidance for historical commits?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-09-05T20:31:30Z","receivedAt":"2017-09-05T20:31:40Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 05, 2017 at 12:47:43PM +0000, wafflecode@openmail.cc wrote:\n\n> Is just dropping a \".gitignore\" or \"README\" file in the empty directories\n> during conversion still the most reasonable approach?\n\nYes, I think so.\n\n> If so, is there a way\n> to do this automatically during the conversion using \"git svn\" or the like?\n\nI haven't used git-svn in years, but the manpage says:\n\n  --preserve-empty-dirs\n      Create a placeholder file in the local Git repository for each\n      empty directory fetched from Subversion. This includes directories\n      that become empty by removing all entries in the Subversion\n      repository (but not the directory itself). The placeholder files\n      are also tracked and removed when no longer necessary.\n\n-Peff\n"},{"id":"327618","messageId":"20170905221732.Horde.QL8bINNPhkH82YmIiqhsUY9@vfemail.net","threadId":"46705","inReplyTo":"f8ed8f0b-a2e1-9e7a-bf79-2b7629b838f2@web.de","subject":"Re: Empty directories in Git: Current guidance for historical commits?","fromName":"","fromEmail":"wafflecode@openmail.cc","sentAt":"2017-09-05T22:17:32Z","receivedAt":"2017-09-06T00:18:45Z","isPatch":false,"sender":{"key":"wafflecode@openmail.cc","avatar":null},"body":"\nQuoting Torsten Bögershausen <tboegi@web.de>:\n\n>> Is just dropping a \".gitignore\" or \"README\" file in the empty  \n>> directories during\n>> conversion still the most reasonable approach?\n>\n> A .gitignore will, but may cost 0.001% CPU time when running \"git status\".\n> I have seen systems that create a file called \".empty\" in every directory.\n>\n>> If so, is there a way to do this\n>> automatically during the conversion using \"git svn\" or the like?\n>\n> Not what I am aware of.\n> And even if, the .empty files need to be removed, once the directory is\n> removed.\n> And we don't have logic for that, as far as I know.\n>\n\nSo upon re-reading the git-svn docs, there apparently _are_  \n\"--preserve-empty-dirs\" and \"--placeholder-filename=<filename>\" options.\n\nI'm not sure how I missed these.  :-/\n\nIf I understand correctly, it sounds like exactly what I want.  i.e. a  \nplaceholder file being added (and tracked) to each empty folder.  Are  \nthere known issues or limitations to be aware of?\n\n\nThank you,\nDavid\n\n\n-------------------------------------------------\n\nONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!\n$24.95 ONETIME Lifetime accounts with Privacy Features!  \n15GB disk! No bandwidth quotas!\nCommercial and Bulk Mail Options!  \n"}]}