git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Gossage <jgossage@gmail.com>
To: Ferry Huberts <ferry.huberts@pelagic.nl>
Cc: git@vger.kernel.org
Subject: Re: [EGIT] [PATCH RFC v1 0/5] Add (static) ignore functionality to EGit
Date: Sun, 29 Mar 2009 18:40:59 -0600	[thread overview]
Message-ID: <49D0151B.6070408@magma.ca> (raw)
In-Reply-To: <cover.1238102327.git.ferry.huberts@pelagic.nl>

Ferry Huberts wrote:
> This is the first - early - code that adds ignore functionality to EGit.
> Currently it reads in all ignore patterns upon workspace startup into an
> ignore cache. From this cache the ignore state of a resource is evaluated
> in the same fashion as git does.
>
> The code does not yet react to changes in ignore files but I'm planning to add
> that soon and I can share a lot of code for that.
>
> I send this code to receive feedback and to give you insight into what I'm
> doing with it. I'm new both to EGit programming and Eclipse programming so
> there might be things that could be done more elegantly :-)
>
> A few notes:
> - The patches are rebased on the current master (e3440623)
> - The order of the patches must be re-arranged, but that is rather easy. The
>   correct order - once finished - would be:
>     Build up the ignore patterns cache upon workspace startup.
>     Use the ignore patterns cache to determine ignores
>     Enable the ignore handling of the plugin
>     Optimise ignore evaluation
>     Do not set .git as a Team ignore pattern
> - The core.excludesfile code is currently untested, the other code seems to be
>   in a good state.
> - There are a few FIXMEs in the code with questions and tasks. It's a work in
>   progress and these will disappear.
>
> Ferry Huberts (5):
>   Build up the ignore patterns cache upon workspace startup.
>   Enable the ignore handling of the plugin
>   Optimise ignore evaluation
>   Do not set .git as a Team ignore pattern
>   Use the ignore patterns cache to determine ignores
>
>  org.spearce.egit.core/META-INF/MANIFEST.MF         |    1 +
>  org.spearce.egit.core/plugin.xml                   |    6 -
>  .../src/org/spearce/egit/core/ignores/DType.java   |   44 ++
>  .../src/org/spearce/egit/core/ignores/Exclude.java |  243 +++++++++
>  .../spearce/egit/core/ignores/GitIgnoreData.java   |  180 +++++++
>  .../org/spearce/egit/core/ignores/IgnoreFile.java  |   82 +++
>  .../egit/core/ignores/IgnoreFileOutside.java       |  543 ++++++++++++++++++++
>  .../egit/core/ignores/IgnoreProjectCache.java      |  245 +++++++++
>  .../egit/core/ignores/IgnoreRepositoryCache.java   |  358 +++++++++++++
>  .../org/spearce/egit/core/op/TrackOperation.java   |    7 +-
>  .../spearce/egit/core/project/GitProjectData.java  |    8 +
>  .../decorators/DecoratableResourceAdapter.java     |   11 +-
>  org.spearce.jgit/META-INF/MANIFEST.MF              |    1 +
>  13 files changed, 1712 insertions(+), 17 deletions(-)
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/DType.java
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/Exclude.java
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/GitIgnoreData.java
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/IgnoreFile.java
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/IgnoreFileOutside.java
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/IgnoreProjectCache.java
>  create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/ignores/IgnoreRepositoryCache.java
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>   

Eclipse supplies a repository-independent ignore file list as part of the repository-type independent Team support. A first step, which would provide useful functionality would be to populate your cache with this list and enable it's use in the Egit plugin. This would accomplish the goal of enabling EGit to use ignore lists in an immediately useful way with minimal effort. As a second stage you can add support for picking up Git specific files and updating them from Eclipse.

I think you will run into problems if you try to create a workspace wide
cache. It is quite possible that one workspace could have projects that
target different Git repositories. This means that your cache would need
to look at all projects in the workspace and potentially take into
account Eclipse working sets and other such complications. You also will
need to deal with projects being added and deleted from the Eclipse
workspace.

I think a better approach might be to go for lazy cache construction
where the cache is built only when actually needed by a user operation.
The cache would then be built only for a specific Git repository. JGit
should be responsible for assembling a merged list from the various Git
files. It should also be responsible for the actual updating of the
various Git ignore files. Since I believe that the Eclipse
repository-independent ignore file list should be the lowest priority in
the merged list, it will be necessary to pass the Eclipse list to JGit
as a parameter whenever a merged list is required.

In general, you should look to do Git specific things in JGit and do
Eclipse things in Eclipse. That way JGit continues to acquire the
functionality to support any IDE and EGit is kept as simple as possible.

HTH

Jonathan Gossage

  parent reply	other threads:[~2009-03-30  0:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 21:34 [EGIT] [PATCH RFC v1 0/5] Add (static) ignore functionality to EGit Ferry Huberts
2009-03-26 21:34 ` [EGIT] [PATCH RFC v1 1/5] Build up the ignore patterns cache upon workspace startup Ferry Huberts
2009-03-26 21:34   ` [EGIT] [PATCH RFC v1 2/5] Enable the ignore handling of the plugin Ferry Huberts
2009-03-26 21:34     ` [EGIT] [PATCH RFC v1 3/5] Optimise ignore evaluation Ferry Huberts
2009-03-26 21:34       ` [EGIT] [PATCH RFC v1 4/5] Do not set .git as a Team ignore pattern Ferry Huberts
2009-03-26 21:34         ` [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores Ferry Huberts
2009-03-29  9:23 ` [EGIT] [PATCH RFC v1 0/5] Add (static) ignore functionality to EGit Robin Rosenberg
2009-03-29 10:43   ` Ferry Huberts (Pelagic)
2009-03-30  4:27     ` Shawn O. Pearce
2009-03-30  0:40 ` Jonathan Gossage [this message]
2009-03-30  6:18   ` Robin Rosenberg
2009-04-05 21:02 ` Shawn O. Pearce
2009-04-06 16:46   ` Ferry Huberts (Pelagic)
2009-04-06 16:51   ` Ferry Huberts (Pelagic)
2009-04-06 17:03     ` Shawn O. Pearce
2009-04-06 17:38     ` Sverre Rabbelier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49D0151B.6070408@magma.ca \
    --to=jgossage@gmail.com \
    --cc=ferry.huberts@pelagic.nl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).