Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Should an empty bin/ directory be checked in?
Should an empty bin/ directory be checked in? [message #777310] Tue, 10 January 2012 09:08 Go to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
Our Java projects (mostly plugins) use a fairly standard layout, with Java source in src/ (and sometimes test/) directories, which get compiled to a bin/ directory. Obviously, the source code, but not the compiled classes, get checked in to the repository.

Previously, we used subversion, and had svn:ignore set so that neither bin/ nor its contents were checked in to the respoitory. Hence there is no bin/ in the repository at all.

We're moving to Git, so I'm reviewing the way we do things. What's best:

(1) Don't have bin/ in the respository (specified by .gitignore in the project parent directory)
OR
(2) Check an empty bin/ in the respository (empty except for a .gitignore in the bin/ directory)

Is one way better than the other, or is it just a case of personal preference? I'm leaning towards (2).

Thanks
Matthew
Re: Should an empty bin/ directory be checked in? [message #777320 is a reply to message #777310] Tue, 10 January 2012 09:16 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 10.01.2012 10:08, Matthew Webber wrote:
> Our Java projects (mostly plugins) use a fairly standard layout, with
> Java source in src/ (and sometimes test/) directories, which get
> compiled to a bin/ directory. Obviously, the source code, but not the
> compiled classes, get checked in to the repository.
>
> Previously, we used subversion, and had svn:ignore set so that neither
> bin/ nor its contents were checked in to the respoitory. Hence there
> is no bin/ in the repository at all.
>
> We're moving to Git, so I'm reviewing the way we do things. What's best:
>
> (1) Don't have bin/ in the respository (specified by .gitignore in the
> project parent directory)
You should add
/*/bin/
in order to avoid that some random 'bin' folder gets excluded. Storing
an empty 'bin' folder doesn't buy you anything.

Dani
> OR
> (2) Check an empty bin/ in the respository (empty except for a
> .gitignore in the bin/ directory)
>
> Is one way better than the other, or is it just a case of personal
> preference? I'm leaning towards (2).
>
> Thanks
> Matthew
>
Re: Should an empty bin/ directory be checked in? [message #778565 is a reply to message #777310] Fri, 13 January 2012 09:58 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Git can't track empty folders.
Re: Should an empty bin/ directory be checked in? [message #778708 is a reply to message #778565] Fri, 13 January 2012 17:08 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
> Git can't track empty folders

Yes I know that, that's why I said "(empty except for a .gitignore in the bin/ directory)"

On reflection, this is not really a Git question per se. The question really is "should a placeholder bin/ directory be checked in to the respository". If this answer is yes, then I know how to do it in Git.

Thanks
Re: Should an empty bin/ directory be checked in? [message #778848 is a reply to message #778708] Sat, 14 January 2012 00:05 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Matthew Webber skrev 2012-01-13 18.08:
>> Git can't track empty folders
>
> Yes I know that, that's why I said "(empty except for a .gitignore in the bin/ directory)"
>
> On reflection, this is not really a Git question per se. The question really is "should a placeholder bin/ directory be checked in to the respository". If this answer is
> yes, then I know how to do it in Git.
>

A: no

Build tools in general create output directories for you. Then on clean the remove
them (and your .gitignore) causing a lot of pain.

-- robin
Re: Should an empty bin/ directory be checked in? [message #779384 is a reply to message #778848] Sun, 15 January 2012 15:28 Go to previous message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
There's rarely any point in tracking only a .gitignore in any given directory. It really only makes sense if the directory meets two conditions: it must exist AND it isn't created automatically on demand. That's an unusual combination and definitely doesn't apply in the case you mention. Worse, as Robin points out, a standard clean operation will delete the directory, forcing you to restore the tracked .gitignore.

Previous Topic:Problems with autocrlf
Next Topic:Survey: key missing features
Goto Forum:
  


Current Time: Fri Apr 19 15:35:22 GMT 2024

Powered by FUDForum. Page generated in 0.02505 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top