All of lore.kernel.org
 help / color / mirror / Atom feed
* empty directories and git Question
@ 2010-09-16  7:59 Anton
  2010-09-16  8:32 ` Andreas Ericsson
  0 siblings, 1 reply; 4+ messages in thread
From: Anton @ 2010-09-16  7:59 UTC (permalink / raw)
  To: git

Hi!

I am using git for a very long time with TextMate and Ruby on Rails,
now I am working with Eclipse and Android and I have a stupid problem
(or I am stupid...). Can anybody help me?

I have directories which I do not want to track in git (like gen/* an bin/*).
They can be ignored by adding them to the .gitignore - works well.

But when I clone the project Eclipse shouts about the missing directories.
So I tried the following:

added a .ignoreme file to "bin" and "gen", ignored everything else.
Works fine, now the directory and the two .ignoreme files are added,
but Eclipse does not like to have any file in the bin directory
(can't build until I remove it).

So it there no way to manage bin folders of any kind
in git when working with IDEs?

Thank you very much in advance!

Regards,
Anton

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: empty directories and git Question
  2010-09-16  7:59 empty directories and git Question Anton
@ 2010-09-16  8:32 ` Andreas Ericsson
  2010-09-16 19:30   ` Kevin Ballard
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Ericsson @ 2010-09-16  8:32 UTC (permalink / raw)
  To: Anton; +Cc: git

On 09/16/2010 09:59 AM, Anton wrote:
> Hi!
> 
> I am using git for a very long time with TextMate and Ruby on Rails,
> now I am working with Eclipse and Android and I have a stupid problem
> (or I am stupid...). Can anybody help me?
> 
> I have directories which I do not want to track in git (like gen/* an bin/*).
> They can be ignored by adding them to the .gitignore - works well.
> 
> But when I clone the project Eclipse shouts about the missing directories.
> So I tried the following:
> 
> added a .ignoreme file to "bin" and "gen", ignored everything else.
> Works fine, now the directory and the two .ignoreme files are added,
> but Eclipse does not like to have any file in the bin directory
> (can't build until I remove it).
> 
> So it there no way to manage bin folders of any kind
> in git when working with IDEs?
> 

You can't have empty directories in git. Eclipse forcing you to have a
pre-created empty directory that it doesn't create itself if it doesn't
exist sounds mightily weird though. I'd guess there's some setting in
eclipse that tells it to automagically create or wipe the directory if
it needs to. It's not like it's a small project, so I can't imagine a
simple thing like that not being handled.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: empty directories and git Question
  2010-09-16  8:32 ` Andreas Ericsson
@ 2010-09-16 19:30   ` Kevin Ballard
  2010-09-16 20:02     ` empty directories and git Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ballard @ 2010-09-16 19:30 UTC (permalink / raw)
  To: Git Mailing List

Apologies to those who were CC'd on the original message, I'm resending to this list as I forgot to set plain text.

I'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.

-Kevin Ballard

On Sep 16, 2010, at 1:32 AM, Andreas Ericsson wrote:

> You can't have empty directories in git.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: empty directories and git
  2010-09-16 19:30   ` Kevin Ballard
@ 2010-09-16 20:02     ` Jakub Narebski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2010-09-16 20:02 UTC (permalink / raw)
  To: Kevin Ballard; +Cc: Git Mailing List, Anton, Andreas Ericsson

Kevin Ballard <kevin@sb.org> writes:
> On Sep 16, 2010, at 1:32 AM, Andreas Ericsson wrote:
> 
> > You can't have empty directories in git.

> Apologies to those who were CC'd on the original message, I'm
> resending to this list as I forgot to set plain text.
> 
> I'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.

If I understand it correctly the problem is that git index is flat
structure that contains only file (blob) info; there is currently no
place in it to store information that some empty directory was added.

Adding an extension to have directories in index was considered in the
past; it could even speed up git a bit, I think.
-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-16 20:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-16  7:59 empty directories and git Question Anton
2010-09-16  8:32 ` Andreas Ericsson
2010-09-16 19:30   ` Kevin Ballard
2010-09-16 20:02     ` empty directories and git Jakub Narebski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.