threads / discuss / 18065

jgit and ignore

Subject: jgit and ignore

## tl;dr

23 messages between Feb 28, 2009 and Mar 4, 2009.

replies: 22people: 5as markdown or json

Jon Smirl· Feb 28, 2009, 16:31 UTC · lore
I'm using jgit in eclipse. Works great for me.

I have a couple of generated files in my working directory. There doesn't seem to be any UI for ignoring them. Is it there and I just can't find it?

-- 
Jon Smirl
jonsmirl@gmail.com
Shawn O. Pearce· Feb 28, 2009, 17:26 UTC · re: Jon Smirl · lore

Re: jgit and ignore

Jon Smirl <jonsmirl@gmail.com> wrote:
> I'm using jgit in eclipse. Works great for me.
 
Yay!
> I have a couple of generated files in my working directory. There
> doesn't seem to be any UI for ignoring them. Is it there and I just
> can't find it?

EGit doesn't (yet) honor the .gitignore files like it should. Someone (Ferry i-forget-the-rest-of-his-name) is working on adding ignore support and has patches in flight for at least some of it.

-- 
Shawn.
Ferry Huberts (Pelagic)· Mar 1, 2009, 10:11 UTC · re: Shawn O. Pearce · lore

Re: jgit and ignore

Shawn O. Pearce wrote:
Show 13 quoted lines
> Jon Smirl <jonsmirl@gmail.com> wrote:
>> I'm using jgit in eclipse. Works great for me.
>  
> Yay!
> 
>> I have a couple of generated files in my working directory. There
>> doesn't seem to be any UI for ignoring them. Is it there and I just
>> can't find it?
> 
> EGit doesn't (yet) honor the .gitignore files like it should. Someone
> (Ferry i-forget-the-rest-of-his-name) is working on adding ignore
> support and has patches in flight for at least some of it.
> 
Ferry i-do-remember-my-name Huberts is working on it :-)

I have most of it working in a basic form already but am currently refactoring things to take care of some nasty little details. Expect something to arrive within (my best guesstimate) about 3 to 4 weeks. after next week I'll be skiing for a week, so no coding then :-)

For the new functionality: You don't really need a UI: just add a .gitignore file with a pattern and the plugin will pick it up and show you what is ignored by means of a nice little decoration.

Ferry
Jon Smirl· Mar 1, 2009, 12:54 UTC · re: Ferry Huberts (Pelagic) · lore

Re: jgit and ignore

On Sun, Mar 1, 2009 at 5:11 AM, Ferry Huberts (Pelagic) <ferry.huberts@pelagic.nl> wrote:

Show 25 quoted lines
> Shawn O. Pearce wrote:
>> Jon Smirl <jonsmirl@gmail.com> wrote:
>>> I'm using jgit in eclipse. Works great for me.
>>
>> Yay!
>>
>>> I have a couple of generated files in my working directory. There
>>> doesn't seem to be any UI for ignoring them. Is it there and I just
>>> can't find it?
>>
>> EGit doesn't (yet) honor the .gitignore files like it should. Someone
>> (Ferry i-forget-the-rest-of-his-name) is working on adding ignore
>> support and has patches in flight for at least some of it.
>>
> Ferry i-do-remember-my-name Huberts is working on it :-)
>
> I have most of it working in a basic form already but am currently
> refactoring things to take care of some nasty little details.
> Expect something to arrive within (my best guesstimate) about 3 to 4
> weeks. after next week I'll be skiing for a week, so no coding then :-)
>
> For the new functionality:
> You don't really need a UI: just add a .gitignore file with a pattern
> and the plugin will pick it up and show you what is ignored by means of
> a nice little decoration.

I expected it to work by right clicking the file and picking team/ignore. This would add the file name .gitignore and automatically add .gitignore to my commit. It would also alter the eclipse filter to make the file disappear in the eclipse browser.

>
> Ferry
>
-- 
Jon Smirl
jonsmirl@gmail.com
Ferry Huberts (Pelagic)· Mar 1, 2009, 13:06 UTC · re: Jon Smirl · lore

Re: jgit and ignore

Jon Smirl wrote:
Show 31 quoted lines
> On Sun, Mar 1, 2009 at 5:11 AM, Ferry Huberts (Pelagic)
> <ferry.huberts@pelagic.nl> wrote:
>> Shawn O. Pearce wrote:
>>> Jon Smirl <jonsmirl@gmail.com> wrote:
>>>> I'm using jgit in eclipse. Works great for me.
>>> Yay!
>>>
>>>> I have a couple of generated files in my working directory. There
>>>> doesn't seem to be any UI for ignoring them. Is it there and I just
>>>> can't find it?
>>> EGit doesn't (yet) honor the .gitignore files like it should. Someone
>>> (Ferry i-forget-the-rest-of-his-name) is working on adding ignore
>>> support and has patches in flight for at least some of it.
>>>
>> Ferry i-do-remember-my-name Huberts is working on it :-)
>>
>> I have most of it working in a basic form already but am currently
>> refactoring things to take care of some nasty little details.
>> Expect something to arrive within (my best guesstimate) about 3 to 4
>> weeks. after next week I'll be skiing for a week, so no coding then :-)
>>
>> For the new functionality:
>> You don't really need a UI: just add a .gitignore file with a pattern
>> and the plugin will pick it up and show you what is ignored by means of
>> a nice little decoration.
> 
> I expected it to work by right clicking the file and picking
> team/ignore. This would add the file name .gitignore and automatically
> add .gitignore to my commit. It would also alter the eclipse filter to
> make the file disappear in the eclipse browser.
> 
that'll come later, first we need to ignore the same files as git :-)
which eclipse browser?

BTW. the plugin will not look at the eclipse filter for ignore files once I've finished the implementation. that's the only way to make sure that we ignore resources in exactly the same way as git does: git only ignores on the basis of .gitignore files, command line options (we do not have those for the plugin), and the info/exclude file in the repository.

Tor Arne Vestbø· Mar 1, 2009, 13:34 UTC · re: Ferry Huberts (Pelagic) · lore

Re: jgit and ignore

Ferry Huberts (Pelagic) wrote:
Show 5 quoted lines
> BTW. the plugin will not look at the eclipse filter for ignore files
> once I've finished the implementation. that's the only way to make sure
> that we ignore resources in exactly the same way as git does: git only
> ignores on the basis of .gitignore files, command line options (we do
> not have those for the plugin), and the info/exclude file in the repository.

You're missing one: the file specified by the configuration variable core.excludesfile, which can be though of as a global ignore filter.

The manual says:

"Patterns which a user wants git to ignore in all situations (e.g., backup or temporary files generated by the user's editor of choice) generally go into a file specified by core.excludesfile in the user's ~/.gitconfig."

This is _exactly_ what Eclipse's Team->Ignored Resources is for.

I see two groups of users: a) those with a global ignore specified in core.excludesfile b) and those without (they may not even have cgit installed, if EGit is bundled with Eclipse in the future).

In my opinion, EGit should default to using Eclipse's built in ignores, but then detect the presence of a global core.excludesfile, in which case it would notify the user ("I see you have a core.excludesfile") and let the user switch to using that one instead.

In other words, whether or not to use core.excludesfile or Eclipse's global team ignores should be optional, and we should provide heuristics for deciding when to switch.

I think that would cover both groups of users without causing confusion.
Tor Arne
Ferry Huberts (Pelagic)· Mar 1, 2009, 13:47 UTC · re: Tor Arne Vestbø · lore

Re: jgit and ignore

Tor Arne Vestbø wrote:
Show 35 quoted lines
> Ferry Huberts (Pelagic) wrote:
>> BTW. the plugin will not look at the eclipse filter for ignore files
>> once I've finished the implementation. that's the only way to make sure
>> that we ignore resources in exactly the same way as git does: git only
>> ignores on the basis of .gitignore files, command line options (we do
>> not have those for the plugin), and the info/exclude file in the repository.
> 
> You're missing one: the file specified by the configuration variable
> core.excludesfile, which can be though of as a global ignore filter.
> 
> The manual says:
> 
> "Patterns which a user wants git to ignore in all situations (e.g.,
> backup or temporary files generated by the user's editor of choice)
> generally go into a file specified by core.excludesfile in the user's
> ~/.gitconfig."
> 
> This is _exactly_ what Eclipse's Team->Ignored Resources is for.
> 
> I see two groups of users: a) those with a global ignore specified in
> core.excludesfile b) and those without (they may not even have cgit
> installed, if EGit is bundled with Eclipse in the future).
> 
> In my opinion, EGit should default to using Eclipse's built in ignores,
> but then detect the presence of a global core.excludesfile, in which
> case it would notify the user ("I see you have a core.excludesfile") and
> let the user switch to using that one instead.
> 
> In other words, whether or not to use core.excludesfile or Eclipse's
> global team ignores should be optional, and we should provide heuristics
> for deciding when to switch.
> 
> I think that would cover both groups of users without causing confusion.
> 
> Tor Arne

Ok, missed that one. I'll have to think a bit on how to incorporate that one but I think it's doable in a relatively easy way.

I do not agree with your propasal however. We then would have different behaviour between how 'git' behaves within Eclipse (by means of the plugin) and how 'git' behaves within the command line. That alone can cause much more confusion.

Your proposal can also be implemented differently by (for example) building a UI that allows the user to edit the global ignore file. The Eclipse global team ignores simply are too broad: think of the situation where I also have non-git project (like svn) in my workspace.

Tor Arne Vestbø· Mar 1, 2009, 14:58 UTC · re: Ferry Huberts (Pelagic) · lore

Re: jgit and ignore

Ferry Huberts (Pelagic) wrote:
Show 5 quoted lines
> Tor Arne Vestbø wrote:
>> In my opinion, EGit should default to using Eclipse's built in ignores,
>> but then detect the presence of a global core.excludesfile, in which
>> case it would notify the user ("I see you have a core.excludesfile") and
>> let the user switch to using that one instead.
[snip]
First of all, I do appreciate you working on the ignore feature :)
> I do not agree with your propasal however.
> We then would have different behaviour between how 'git' behaves within
> Eclipse (by means of the plugin) and how 'git' behaves within the
> command line. That alone can cause much more confusion.

I see what you mean, and I agree that in general the command line git porcelain and the Eclipse git porcelain should work in similar ways.

But, with that said, I think of EGit as a standalone Eclipse-plugin implementation of the git porcelain -- not just a wrapper around the command line porcelain.

To me that means that EGit should focus just as much on integrating with Eclipse properly as it does on keeping command line porcelain interoperability.

The core.excludesfile is one such case, and I think my proposal is a good compromise.

> Your proposal can also be implemented differently by (for example)
> building a UI that allows the user to edit the global ignore file.

That would be going out of scope of Eclipse as a framework, and also does not solve the problem for those users who have a list of global team ignores, and expect the Git plugin to just work with those ignores.

> The Eclipse global team ignores simply are too broad: think of the
> situation where I also have non-git project (like svn) in my workspace.

Not sure I understand? Isn't that exactly why you would have Eclipse's global ignores specified in one place -- so that they could be shared between version control systems instead of replicated in each repo?

Let' say you have a CVS project, a SVN project, and a Git project in your workspace. The CVS and SVN projects would pick up ".bak" as an ignore pattern from your team ignores, but the Git project would not.

To make the Git project pick it up, you would have to either add it (repatedly for more than one project) to the .gitignore of that project, or open an editor outside of Eclipse to edit your ~/.gitconfig.

Either ways seem redundant and awkward to me.
Tor Arne
Shawn O. Pearce· Mar 1, 2009, 17:16 UTC · re: Tor Arne Vestbø · lore

Re: jgit and ignore

Tor Arne Vestbø <torarnv@gmail.com> wrote:
> 
> But, with that said, I think of EGit as a standalone Eclipse-plugin
> implementation of the git porcelain -- not just a wrapper around the
> command line porcelain.
Yes, exactly.  JGit is about keeping on-disk and on-network binary
compatability with git-core.  But we don't necessarily need to keep
UI or behavior always the same within the porcelain that uses that
library, aka EGit.
 
> To me that means that EGit should focus just as much on integrating with
> Eclipse properly as it does on keeping command line porcelain
> interoperability.
Yup, I agree completely.  I think Robin would too.
 
> The core.excludesfile is one such case, and I think my proposal is a
> good compromise.
IMHO, we should honor ignores in EGit as:
  per-directory .gitignore
  per-repostiory GIT_DIR/info/exclude
  per-repository core.excludesfile (yes, really, it can be per
  repository, which overrides ~/.gitconfig setting of same)
  Eclipse global team ignore patterns

Skipping the core.excludesfile in favor of only the Eclipse global team ignores feels wrong to me, as we may be missing something the user has configured. FWIW, I think core.excludesfile is a lot less frequently used then .gitignore and GIT_DIR/info/exclude. If there is a core.excludesfile, the user is a pretty advanced user and they really want that behavior to be honored by Git poreclain. EGit should honor it.

But likewise with the global team ignores. I think most people set up ignores in their VCS, so they are distributed to everyone on the project automatically. But if you do twiddle your own workspace settings, we should honor them.

-- 
Shawn.
Tor Arne Vestbø· Mar 1, 2009, 17:42 UTC · re: Shawn O. Pearce · lore

Re: jgit and ignore

Shawn O. Pearce wrote:
Show 9 quoted lines
> IMHO, we should honor ignores in EGit as:
> 
>   per-directory .gitignore
>   per-repostiory GIT_DIR/info/exclude
> 
>   per-repository core.excludesfile (yes, really, it can be per
>   repository, which overrides ~/.gitconfig setting of same)
> 
>   Eclipse global team ignore patterns

Just to be clear, I noticed you left out the global core.excludesfile (from ~/.gitconfig) here. I guess this intentional?

Or should we combine the ignores from the global team ignores and the ignores from the global core.excludesfile in ~/.gitconfig?

Either way, I full agree that we should honor all repository ignores (whether they are in directory .gitignores, info/exclude, or given by repository-specific core.excludesfile).

Tor Arne
Shawn O. Pearce· Mar 1, 2009, 17:49 UTC · re: Tor Arne Vestbø · lore

Re: jgit and ignore

Tor Arne Vestbø <torarnv@gmail.com> wrote:
Show 13 quoted lines
> Shawn O. Pearce wrote:
> > IMHO, we should honor ignores in EGit as:
> > 
> >   per-directory .gitignore
> >   per-repostiory GIT_DIR/info/exclude
> > 
> >   per-repository core.excludesfile (yes, really, it can be per
> >   repository, which overrides ~/.gitconfig setting of same)
> > 
> >   Eclipse global team ignore patterns
> 
> Just to be clear, I noticed you left out the global core.excludesfile
> (from ~/.gitconfig) here. I guess this intentional?
No, I didn't.  core.excludesfile is read from the config, the config
is a union of /etc/gitconfig, ~/.gitconfig, and GIT_DIR/config.  The
last setting wins.
 
Show 6 quoted lines
> Or should we combine the ignores from the global team ignores and the
> ignores from the global core.excludesfile in ~/.gitconfig?
>
> Either way, I full agree that we should honor all repository ignores
> (whether they are in directory .gitignores, info/exclude, or given by
> repository-specific core.excludesfile).

Right. See my reply to Ferry, we union all of them together, but in the case of core.excludesfile we have to honor what the repository is telling us is the correct setting for that one repository, which may differ from other repositories if it has been overridden.

-- 
Shawn.
Tor Arne Vestbø· Mar 1, 2009, 17:51 UTC · re: Shawn O. Pearce · lore

Re: jgit and ignore

Shawn O. Pearce wrote:
Show 6 quoted lines
>> Just to be clear, I noticed you left out the global core.excludesfile
>> (from ~/.gitconfig) here. I guess this intentional?
> 
> No, I didn't.  core.excludesfile is read from the config, the config
> is a union of /etc/gitconfig, ~/.gitconfig, and GIT_DIR/config.  The
> last setting wins.

Ah, I see, I thought each config was read in a separate steps. Thanks for clearing that up.

Show 8 quoted lines
>> Either way, I full agree that we should honor all repository ignores
>> (whether they are in directory .gitignores, info/exclude, or given by
>> repository-specific core.excludesfile).
> 
> Right.  See my reply to Ferry, we union all of them together, but in
> the case of core.excludesfile we have to honor what the repository
> is telling us is the correct setting for that one repository,
> which may differ from other repositories if it has been overridden.
Yepp, full ack.
Tor Arne
Shawn O. Pearce· Mar 1, 2009, 17:57 UTC · re: Tor Arne Vestbø · lore

Re: jgit and ignore

Tor Arne Vestbø <torarnv@gmail.com> wrote:
Show 10 quoted lines
> Shawn O. Pearce wrote:
> >> Just to be clear, I noticed you left out the global core.excludesfile
> >> (from ~/.gitconfig) here. I guess this intentional?
> > 
> > No, I didn't.  core.excludesfile is read from the config, the config
> > is a union of /etc/gitconfig, ~/.gitconfig, and GIT_DIR/config.  The
> > last setting wins.
> 
> Ah, I see, I thought each config was read in a separate steps. Thanks
> for clearing that up.
Well, they are.

But in git-core the value is pulled into a single static. For a string its often a single static char*. So the config handle function is called up to 3 times for foo.bar, and the last one to be called is the one that finally set the value. They are read in the order I described above, so GIT_DIR/config has a chance to override any prior setting.

In JGit the RepositoryConfig object parses the other direction. Its a more classical "default" pattern, where if GIT_DIR/config doesn't have a foo.bar we call to another instance which had parsed ~/.gitconfig, and so on.

Either way produces the same result.
-- 
Shawn.
Ferry Huberts (Pelagic)· Mar 1, 2009, 17:43 UTC · re: Shawn O. Pearce · lore

Re: jgit and ignore

Show 7 quoted lines
> IMHO, we should honor ignores in EGit as:
> 
>   per-directory .gitignore
>   per-repostiory GIT_DIR/info/exclude
> 
>   per-repository core.excludesfile (yes, really, it can be per
>   repository, which overrides ~/.gitconfig setting of same)
wow. override? really?
> 
>   Eclipse global team ignore patterns
> 

so, should these then override, supplement, or something else? the per-repo files (.gitignore's and info/exclude supplement eachother.

Show 7 quoted lines
> Skipping the core.excludesfile in favor of only the Eclipse global
> team ignores feels wrong to me, as we may be missing something
> the user has configured.  FWIW, I think core.excludesfile is a
> lot less frequently used then .gitignore and GIT_DIR/info/exclude.
> If there is a core.excludesfile, the user is a pretty advanced user
> and they really want that behavior to be honored by Git poreclain.
> EGit should honor it.

I could also argue that an advanced user would expect Egit and git to behave the same. especially for advanced features. and even more so because EGit now is very basic and to be able to use the advanced features you have to switch to the commandline from Eclipse. making this a very very real use-case for EGit usage.

Once we have more advanced features implemented this use-case will become less prevalent and only then I'd (personally) be more inclined to allow more behaviour differences

Shawn O. Pearce· Mar 1, 2009, 17:47 UTC · re: Ferry Huberts (Pelagic) · lore

Re: jgit and ignore

"Ferry Huberts (Pelagic)" <ferry.huberts@pelagic.nl> wrote:
Show 9 quoted lines
> > IMHO, we should honor ignores in EGit as:
> > 
> >   per-directory .gitignore
> >   per-repostiory GIT_DIR/info/exclude
> > 
> >   per-repository core.excludesfile (yes, really, it can be per
> >   repository, which overrides ~/.gitconfig setting of same)
> 
> wow. override? really?

Yes. I'd have to go back and read the git-core code again, but in general a config setting of foo.bar in GIT_DIR/config overrides a foo.bar setting in ~/.gitconfig, *unless* you use the --all flag.

Most of the C code parses as though the last value seen is the
only value set, and GIT_DIR/config is parsed after ~/.gitconfig,
hence it overrides.
 
> >   Eclipse global team ignore patterns
> 
> so, should these then override, supplement, or something else?
> the per-repo files (.gitignore's and info/exclude supplement eachother.
They all supplement each other.  You union every entry in that list
into a single override set and then evaluate against that.  That list
changes with each directory, due to the per-directory .gitignore
possibly changing, but otherwise its fixed for any given repository.
 
-- 
Shawn.
Robin Rosenberg· Mar 1, 2009, 20:24 UTC · re: Shawn O. Pearce · lore

Re: jgit and ignore

Shawn writes:
Show 6 quoted lines
> Tor Arne Vestbø <torarnv@gmail.com> wrote:
> > To me that means that EGit should focus just as much on integrating with
> > Eclipse properly as it does on keeping command line porcelain
> > interoperability.
> 
> Yup, I agree completely.  I think Robin would too.
100% (or close).
-- robin
Ferry Huberts (Pelagic)· Mar 4, 2009, 17:50 UTC · re: Robin Rosenberg · lore

Re: jgit and ignore

Robin Rosenberg wrote:
Show 8 quoted lines
> Shawn writes:
>> Tor Arne Vestbø <torarnv@gmail.com> wrote:
>>> To me that means that EGit should focus just as much on integrating with
>>> Eclipse properly as it does on keeping command line porcelain
>>> interoperability.
>> Yup, I agree completely.  I think Robin would too.
> 100% (or close).
> 
Hey guys

I'm currently refactoring the code to accomodate all of your wishes and I've already come a long way.

==> The one thing that I still need to do is get to the global core.excludefile setting. How can I do that?

How will it work? Read on... :-)

Suppose we have FILE in DIRECTORY and we want to see whether FILE is ignored. (FILE can ofcourse also be a DIR)

The way in which ignores will be evaluated is: 1- See if there is a .gitignore file in DIRECTORY. if so, try to match. when a match is found: FILE is ignored. if there is no .gitignore file or when no match is found: go one directory up (towards the checkout root/workdir) and repeat until a match is found or until the .gitignore in the checkout root/workdir has been evaluated. 2- use the patterns from .git/info/exclude (if exists) and try to match. when a match is found: FILE is ignored. 3- use the patterns from .git/config:core.excludesfile (when set) and try to match. when a match is found: FILE is ignored. 4- when .git/config:core.excludesfile was not set, use the patterns from global:core.excludesfile (when set) and try to match. when a match is found: FILE is ignored. 5- try to match against the Eclipse global Team ignores. when a match is found: FILE is ignored. 6- FILE is not ignored

hope this flow is what you want :-)
Ferry
Ferry Huberts (Pelagic)· Mar 1, 2009, 17:17 UTC · re: Tor Arne Vestbø · lore

Re: jgit and ignore

Tor Arne Vestbø wrote:
Show 30 quoted lines
> Ferry Huberts (Pelagic) wrote:
>> Tor Arne Vestbø wrote:
>>> In my opinion, EGit should default to using Eclipse's built in ignores,
>>> but then detect the presence of a global core.excludesfile, in which
>>> case it would notify the user ("I see you have a core.excludesfile") and
>>> let the user switch to using that one instead.
> 
> [snip]
> 
> First of all, I do appreciate you working on the ignore feature :)
> 
>> I do not agree with your propasal however.
>> We then would have different behaviour between how 'git' behaves within
>> Eclipse (by means of the plugin) and how 'git' behaves within the
>> command line. That alone can cause much more confusion.
> 
> I see what you mean, and I agree that in general the command line git
> porcelain and the Eclipse git porcelain should work in similar ways.
> 
> But, with that said, I think of EGit as a standalone Eclipse-plugin
> implementation of the git porcelain -- not just a wrapper around the
> command line porcelain.
> 
> To me that means that EGit should focus just as much on integrating with
> Eclipse properly as it does on keeping command line porcelain
> interoperability.
> 
> The core.excludesfile is one such case, and I think my proposal is a
> good compromise.
> 

how about we all (especially me) think a bit better on this and solve it later when I've completed the rest? That allows me to focus for now. I think we can easily synchronise between the eclipse global ignores and the core.excludesfile when we (really) want to.

Jon Smirl· Mar 1, 2009, 14:08 UTC · re: Ferry Huberts (Pelagic) · lore

Re: jgit and ignore

On Sun, Mar 1, 2009 at 8:06 AM, Ferry Huberts (Pelagic) <ferry.huberts@pelagic.nl> wrote:

Show 36 quoted lines
> Jon Smirl wrote:
>> On Sun, Mar 1, 2009 at 5:11 AM, Ferry Huberts (Pelagic)
>> <ferry.huberts@pelagic.nl> wrote:
>>> Shawn O. Pearce wrote:
>>>> Jon Smirl <jonsmirl@gmail.com> wrote:
>>>>> I'm using jgit in eclipse. Works great for me.
>>>> Yay!
>>>>
>>>>> I have a couple of generated files in my working directory. There
>>>>> doesn't seem to be any UI for ignoring them. Is it there and I just
>>>>> can't find it?
>>>> EGit doesn't (yet) honor the .gitignore files like it should. Someone
>>>> (Ferry i-forget-the-rest-of-his-name) is working on adding ignore
>>>> support and has patches in flight for at least some of it.
>>>>
>>> Ferry i-do-remember-my-name Huberts is working on it :-)
>>>
>>> I have most of it working in a basic form already but am currently
>>> refactoring things to take care of some nasty little details.
>>> Expect something to arrive within (my best guesstimate) about 3 to 4
>>> weeks. after next week I'll be skiing for a week, so no coding then :-)
>>>
>>> For the new functionality:
>>> You don't really need a UI: just add a .gitignore file with a pattern
>>> and the plugin will pick it up and show you what is ignored by means of
>>> a nice little decoration.
>>
>> I expected it to work by right clicking the file and picking
>> team/ignore. This would add the file name .gitignore and automatically
>> add .gitignore to my commit. It would also alter the eclipse filter to
>> make the file disappear in the eclipse browser.
>>
>
> that'll come later, first we need to ignore the same files as git :-)
>
> which eclipse browser?

I have a C/C++ perspective open right now. Navigator is on the left, editor in the middle, outline on the right. In the navigator there are several files that should be ignored. I'd like to right click on them and select team/ignore. When I do that they will be ignored in git and also disappear from my navigator.

I also don't like how I have a global .git for all of my projects instead of a .git for each project individually. (Did I select that when I first installed egit and didn't know what I was doing?) Now I'm in a mess and can't publish individual projects.

Show 7 quoted lines
>
> BTW. the plugin will not look at the eclipse filter for ignore files
> once I've finished the implementation. that's the only way to make sure
> that we ignore resources in exactly the same way as git does: git only
> ignores on the basis of .gitignore files, command line options (we do
> not have those for the plugin), and the info/exclude file in the repository.
>
-- 
Jon Smirl
jonsmirl@gmail.com
Tor Arne Vestbø· Mar 1, 2009, 14:21 UTC · re: Jon Smirl · lore

Re: jgit and ignore

Jon Smirl wrote:
Show 5 quoted lines
> I have a C/C++ perspective open right now. Navigator is on the left,
> editor in the middle, outline on the right. In the navigator there are
> several files that should be ignored. I'd like to right click on them
> and select team/ignore. When I do that they will be ignored in git and
> also disappear from my navigator.

That would be Team->Add to .gitignore, as Eclipse does not have a way to add files to the global ignore from context menus, but I agree, we should have something like that eventually.

If we were to also remove ignored files from the views we would have to either add a View Filter for .git-ignored files, or for globally ignored files. Good idea for enhancement, please report in the issue tracker:

    http://code.google.com/p/egit/issues/
> I also don't like how I have a global .git for all of my projects
> instead of a .git for each project individually. (Did I select that
> when I first installed egit and didn't know what I was doing?) Now I'm
> in a mess and can't publish individual projects.

That's a result of choosing "Create repository in project's parent directory" when you shared the project in Eclipse.

Perhaps we should try to detect if the project is a Java (/JDT) project, or otherwise likely to be a "child"-project, where it makes sense to have the repository in the parent directory?

Tor Arne
Jon Smirl· Mar 1, 2009, 14:31 UTC · re: Tor Arne Vestbø · lore

Re: jgit and ignore

On Sun, Mar 1, 2009 at 9:21 AM, Tor Arne Vestbø <torarnv@gmail.com> wrote:
Show 28 quoted lines
> Jon Smirl wrote:
>> I have a C/C++ perspective open right now. Navigator is on the left,
>> editor in the middle, outline on the right. In the navigator there are
>> several files that should be ignored. I'd like to right click on them
>> and select team/ignore. When I do that they will be ignored in git and
>> also disappear from my navigator.
>
> That would be Team->Add to .gitignore, as Eclipse does not have a way to
> add files to the global ignore from context menus, but I agree, we
> should have something like that eventually.
>
> If we were to also remove ignored files from the views we would have to
> either add a View Filter for .git-ignored files, or for globally ignored
> files. Good idea for enhancement, please report in the issue tracker:
>
>    http://code.google.com/p/egit/issues/
>
>> I also don't like how I have a global .git for all of my projects
>> instead of a .git for each project individually. (Did I select that
>> when I first installed egit and didn't know what I was doing?) Now I'm
>> in a mess and can't publish individual projects.
>
> That's a result of choosing "Create repository in project's parent
> directory" when you shared the project in Eclipse.
>
> Perhaps we should try to detect if the project is a Java (/JDT) project,
> or otherwise likely to be a "child"-project, where it makes sense to
> have the repository in the parent directory?

My .git got created in my workspace root. Is there ever a case where you would want .git in your workspace root? If not, remove this choice when the parent directory is the workspace root.

>
> Tor Arne
>
>
-- 
Jon Smirl
jonsmirl@gmail.com
Tor Arne Vestbø· Mar 1, 2009, 14:33 UTC · re: Jon Smirl · lore

Re: jgit and ignore

Jon Smirl wrote:
Show 8 quoted lines
> On Sun, Mar 1, 2009 at 9:21 AM, Tor Arne Vestbø <torarnv@gmail.com> wrote:
>> Perhaps we should try to detect if the project is a Java (/JDT) project,
>> or otherwise likely to be a "child"-project, where it makes sense to
>> have the repository in the parent directory?
> 
> My .git got created in my workspace root. Is there ever a case where
> you would want .git in your workspace root? If not, remove this choice
> when the parent directory is the workspace root.

That would be one heuristics to figure out if the option should be enabled or disabled (or hidden) yes.

Could you open an issue in the issue tracker for this?
    http://code.google.com/p/egit/issues/list
Tor Arne
Robin Rosenberg· Mar 1, 2009, 20:47 UTC · re: Jon Smirl · lore

Re: jgit and ignore

Jon Smirl writes:
> My .git got created in my workspace root. Is there ever a case where
> you would want .git in your workspace root? If not, remove this choice
> when the parent directory is the workspace root.

Sure there is. If you create your projects in the workspace, and in particular, directly beneath the workspace root, having the .git directory there is a logical choice. I generally try to create the projects outside the workspace, but Eclipse seems keen on creating projects in the workspace, but that is just my personal preferences and partly for historical reasons.

-- robin

← back to recent threads