{"thread":{"id":"25118","subject":"empty directories and git Question","startedAt":"2010-09-16T07:59:19Z","lastAt":"2010-09-16T20:02:19Z","messageCount":4,"participants":["Anton","Andreas Ericsson","Kevin Ballard","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150790","messageId":"loom.20100916T095344-932@post.gmane.org","threadId":"25118","inReplyTo":null,"subject":"empty directories and git Question","fromName":"Anton","fromEmail":"tmp009@allproducts.info","sentAt":"2010-09-16T07:59:19Z","receivedAt":"2010-09-16T07:59:19Z","isPatch":false,"sender":{"key":"tmp009@allproducts.info","avatar":null},"body":"Hi!\n\nI am using git for a very long time with TextMate and Ruby on Rails,\nnow I am working with Eclipse and Android and I have a stupid problem\n(or I am stupid...). Can anybody help me?\n\nI have directories which I do not want to track in git (like gen/* an bin/*).\nThey can be ignored by adding them to the .gitignore - works well.\n\nBut when I clone the project Eclipse shouts about the missing directories.\nSo I tried the following:\n\nadded a .ignoreme file to \"bin\" and \"gen\", ignored everything else.\nWorks fine, now the directory and the two .ignoreme files are added,\nbut Eclipse does not like to have any file in the bin directory\n(can't build until I remove it).\n\nSo it there no way to manage bin folders of any kind\nin git when working with IDEs?\n\nThank you very much in advance!\n\nRegards,\nAnton\n"},{"id":"150792","messageId":"4C91D631.9010108@op5.se","threadId":"25118","inReplyTo":"loom.20100916T095344-932@post.gmane.org","subject":"Re: empty directories and git Question","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2010-09-16T08:32:49Z","receivedAt":"2010-09-16T08:32:49Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"On 09/16/2010 09:59 AM, Anton wrote:\n> Hi!\n> \n> I am using git for a very long time with TextMate and Ruby on Rails,\n> now I am working with Eclipse and Android and I have a stupid problem\n> (or I am stupid...). Can anybody help me?\n> \n> I have directories which I do not want to track in git (like gen/* an bin/*).\n> They can be ignored by adding them to the .gitignore - works well.\n> \n> But when I clone the project Eclipse shouts about the missing directories.\n> So I tried the following:\n> \n> added a .ignoreme file to \"bin\" and \"gen\", ignored everything else.\n> Works fine, now the directory and the two .ignoreme files are added,\n> but Eclipse does not like to have any file in the bin directory\n> (can't build until I remove it).\n> \n> So it there no way to manage bin folders of any kind\n> in git when working with IDEs?\n> \n\nYou can't have empty directories in git. Eclipse forcing you to have a\npre-created empty directory that it doesn't create itself if it doesn't\nexist sounds mightily weird though. I'd guess there's some setting in\neclipse that tells it to automagically create or wipe the directory if\nit needs to. It's not like it's a small project, so I can't imagine a\nsimple thing like that not being handled.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"150843","messageId":"CDEB2042-A498-4950-A3CD-27F111455234@sb.org","threadId":"25118","inReplyTo":"4C91D631.9010108@op5.se","subject":"Re: empty directories and git Question","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-09-16T19:30:15Z","receivedAt":"2010-09-16T19:30:15Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Apologies to those who were CC'd on the original message, I'm resending to this list as I forgot to set plain text.\n\nI've always wondered about that. Why do we still have this restriction? There is a sha1 hash that is equivalent to the empty tree (4b825dc642cb6eb9a060e54bf8d69288fbee4904). Why can't git just use that to represent an empty directory? I imagine things that touch the working copy may need to be updated to be aware of this, but the problem doesn't seem insurmountable.\n\n-Kevin Ballard\n\nOn Sep 16, 2010, at 1:32 AM, Andreas Ericsson wrote:\n\n> You can't have empty directories in git.\n"},{"id":"150845","messageId":"m3aanhlapl.fsf_-_@localhost.localdomain","threadId":"25118","inReplyTo":"CDEB2042-A498-4950-A3CD-27F111455234@sb.org","subject":"Re: empty directories and git","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-16T20:02:19Z","receivedAt":"2010-09-16T20:02:19Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n> On Sep 16, 2010, at 1:32 AM, Andreas Ericsson wrote:\n> \n> > You can't have empty directories in git.\n\n> Apologies to those who were CC'd on the original message, I'm\n> resending to this list as I forgot to set plain text.\n> \n> I've always wondered about that. Why do we still have this\n> restriction? There is a sha1 hash that is equivalent to the empty\n> tree (4b825dc642cb6eb9a060e54bf8d69288fbee4904). Why can't git just\n> use that to represent an empty directory? I imagine things that\n> touch the working copy may need to be updated to be aware of this,\n> but the problem doesn't seem insurmountable.\n\nIf I understand it correctly the problem is that git index is flat\nstructure that contains only file (blob) info; there is currently no\nplace in it to store information that some empty directory was added.\n\nAdding an extension to have directories in index was considered in the\npast; it could even speed up git a bit, I think.\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}