Can we still manually create a .gitignore?

205 views
Skip to first unread message

Brian Armstrong

unread,
Jun 30, 2009, 4:03:38 PM6/30/09
to nbgit
From what I've read .gitignore support isn't here yet, right?

It it possible to still manually create it? I've created a .gitignore
file in my project root that looks like this, but it doesn't seem to
be working.

log/*.log
tmp/**/*
nbproject/**/*
doc/api
doc/app


nbgit still picks up changes from these files when i do a status
update. Thanks!
Brian

NiGhTHawK

unread,
Jul 12, 2009, 2:48:34 PM7/12/09
to nbgit
Yes .gitignore support isn't available yet...

The .gitignore and .git/info/exclude still works from the command
line, but you probably know this ;)

Brian Armstrong

unread,
Jul 13, 2009, 5:59:38 PM7/13/09
to nbgit
I didn't know...that's actually what I was asking. How do you get it
to work?

I created a .gitignore file as described above but it doesn't seem to
use it. It still shows changed files in my log directory for example
when I go to commit.

Can you describe how you got it working, like where the .gitignore
file it located, a sample format, etc. I'm not familiar with .git/
info/exclude either. Thanks for the info!

NiGhTHawK

unread,
Jul 27, 2009, 3:43:13 AM7/27/09
to nbgit
I think I missed the boat... You talking about from NetBeans...

Sorry I spend alot of time in the commandline and do most of my
commiting and git stuff there...

The .gitignore files go into the directory you want to apply the
ignores to.

.git/info/exclude looks something like this:
<code>
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
*~
/nbproject
/app/config/bootstrap.local.php
/app/tmp/*
/app/tmp/cache/*
/app/tmp/cache/models/*
/app/tmp/cache/persistent/*
/app/tmp/cache/views/*
/app/tmp/logs/*
/app/tmp/sessions/*
/app/tmp/tests/*
/app/webroot/img/upload/
</code>

I think this file is a little overkill for what we need but it's a
good example :)

HTH

Brian Armstrong

unread,
Jul 28, 2009, 7:23:44 AM7/28/09
to nbgit
Ok thanks for the example. Maybe git from the command line is using
the .gignore file, but nbgit doesn't seem to use it. Again, it could
be an error on my part but that's what I've seen so far: nbgit seems
to ignore my manully created .gitignore file.

Jonas Fonseca

unread,
Aug 7, 2009, 1:43:28 PM8/7/09
to nb...@googlegroups.com
On Tue, Jul 28, 2009 at 07:23, Brian Armstrong<barms...@gmail.com> wrote:
> Ok thanks for the example.  Maybe git from the command line is using
> the .gignore file, but nbgit doesn't seem to use it.  Again, it could
> be an error on my part but that's what I've seen so far: nbgit seems
> to ignore my manully created .gitignore file.

Please try out nbgit 0.2, which has initial support for .gitignore
(and .git/info/exclude) files, and report any issues you find.

--
Jonas Fonseca

bhauff

unread,
Aug 10, 2009, 11:46:21 AM8/10/09
to nbgit
I posted a comment in the .gitignore issue. Basically, any changes I
make to the .gitignore will not be reflected until I close and reopen
Netbeans.

Thanks,

Brandon

On Aug 7, 12:43 pm, Jonas Fonseca <jonas.fons...@gmail.com> wrote:

Imran M Yousuf

unread,
Aug 10, 2009, 9:43:28 PM8/10/09
to nb...@googlegroups.com
On Mon, Aug 10, 2009 at 10:46 PM, bhauff<bha...@gmail.com> wrote:
>
> I posted a comment in the .gitignore issue.  Basically, any changes I
> make to the .gitignore will not be reflected until I close and reopen
> Netbeans.

I think for this case the following could be helpful -
http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#addFileChangeListener(org.openide.filesystems.FileChangeListener,%20java.io.File)

Will try it today if time is available.

- Imran

>
> Thanks,
>
> Brandon
>
> On Aug 7, 12:43 pm, Jonas Fonseca <jonas.fons...@gmail.com> wrote:
>> On Tue, Jul 28, 2009 at 07:23, Brian Armstrong<barmstr...@gmail.com> wrote:
>> > Ok thanks for the example.  Maybe git from the command line is using
>> > the .gignore file, but nbgit doesn't seem to use it.  Again, it could
>> > be an error on my part but that's what I've seen so far: nbgit seems
>> > to ignore my manully created .gitignore file.
>>
>> Please try out nbgit 0.2, which has initial support for .gitignore
>> (and .git/info/exclude) files, and report any issues you find.
>>
>> --
>> Jonas Fonseca
>
> >
>



--
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: im...@smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557

Jonas Fonseca

unread,
Aug 10, 2009, 11:10:25 PM8/10/09
to nb...@googlegroups.com
On Mon, Aug 10, 2009 at 21:43, Imran M Yousuf <imyo...@gmail.com> wrote:
>
> On Mon, Aug 10, 2009 at 10:46 PM, bhauff<bha...@gmail.com> wrote:
> >
> > I posted a comment in the .gitignore issue.  Basically, any changes I
> > make to the .gitignore will not be reflected until I close and reopen
> > Netbeans.
>
> I think for this case the following could be helpful -
> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#addFileChangeListener(org.openide.filesystems.FileChangeListener,%20java.io.File)

It says:

"When attached to a file it listens for file changes (due to saving
from inside NetBeans) and for deletes and renames. "

Which means that it won't pick up changes made outside of the IDE. So
I think we still need to have something tracking the
File.lastModified() timestamp or similar. I am currently working on a
per repository PathPattern cache, which should hopefully fix this
issue, provide a good speed up, and cleanup some of the code.

--
Jonas Fonseca

Imran M Yousuf

unread,
Aug 11, 2009, 1:41:09 AM8/11/09
to nb...@googlegroups.com
Thats true but even if we support it being updated from within
NetBeans thats a cool thing; furthermore adding a timer task to
refresh the FileObject will also do the trick. I am already working on
it and will hopefully have a patch ready soon! The pattern cache idea
seems cool!

- Imran

Jonas Fonseca

unread,
Aug 11, 2009, 8:49:36 AM8/11/09
to nb...@googlegroups.com
On Tue, Aug 11, 2009 at 01:41, Imran M Yousuf<imyo...@gmail.com> wrote:
> On Tue, Aug 11, 2009 at 10:10 AM, Jonas Fonseca<jonas....@gmail.com> wrote:
>> On Mon, Aug 10, 2009 at 21:43, Imran M Yousuf <imyo...@gmail.com> wrote:
>>> I think for this case the following could be helpful -
>>> http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#addFileChangeListener(org.openide.filesystems.FileChangeListener,%20java.io.File)
>>
>> It says:
>>
>>  "When attached to a file it listens for file changes (due to saving
>> from inside NetBeans) and for deletes and renames. "
>>
>> Which means that it won't pick up changes made outside of the IDE. So
>> I think we still need to have something tracking the
>> File.lastModified() timestamp or similar. I am currently working on a
>> per repository PathPattern cache, which should hopefully fix this
>> issue, provide a good speed up, and cleanup some of the code.
>
> Thats true but even if we support it being updated from within
> NetBeans thats a cool thing; furthermore adding a timer task to
> refresh the FileObject will also do the trick. I am already working on
> it and will hopefully have a patch ready soon!

Great, this approach would could maybe also be used for tracking
externally modified .git/index and .git/config files so the plugin can
reload the status view and we can ask JGit to reload its repository
data.

> The pattern cache idea seems cool!

I hope it will be. At least it will make it easier to test the code in
charge of managing the loaded ignore patterns.

--
Jonas Fonseca

Brian Armstrong

unread,
Aug 11, 2009, 2:18:17 PM8/11/09
to nbgit
Thanks for the new release! Really appreciate it.

On Aug 11, 9:49 am, Jonas Fonseca <jonas.fons...@gmail.com> wrote:
> On Tue, Aug 11, 2009 at 01:41, Imran M Yousuf<imyou...@gmail.com> wrote:
> > On Tue, Aug 11, 2009 at 10:10 AM, Jonas Fonseca<jonas.fons...@gmail.com> wrote:
> >> On Mon, Aug 10, 2009 at 21:43, Imran M Yousuf <imyou...@gmail.com> wrote:
> >>> I think for this case the following could be helpful -
> >>>http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/open...)

Brian Armstrong

unread,
Aug 15, 2009, 9:23:22 AM8/15/09
to nbgit
Not sure what I'm doing wrong but it still doesn't seem to be working.

Here are the steps to duplicate the problem:

1. delete log/development.log file, commit the deletion using nbgit,
shutdown netbeans
2. create a .gitignore file in the project root, file has just one
line:
log/*.log

3. restart netbeans, start application so it generates some output to
development.log
4. right click project -> Git -> Status
5. development.log still shows in the list of files to commit

If anyone has this working please let me know! I'm using nbgit 0.2

Thanks,
Brian
Reply all
Reply to author
Forward
0 new messages