threads / discuss / 19157

patch, 5 partsAW: [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores

Subject: AW: [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores

## tl;dr

4 messages between May 2, 2009 and May 3, 2009. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Mark Struberg· May 2, 2009, 11:51 UTC · lore
Ferry,
I was just quickly hacking a rudimentary IgnoreRules class in jgit-core [1] mainly for the purpose of not forgetting about handling ignores finally ;)
I now saw you worked on introducing gitignore to EGIT, but wasn't able to find any repo with your code but only a few old patches. 
Do you see a way we can move your work into jgit-core? I've seen you have a lot of Eclipse specific stuff in your code, so we'd obviously have to cut those things in slices.
One possible strategy would be to make the IgnoreRules stuff in jgit-core contain only the 'readonly' evaluation code, thus no addIgnore(File) and addIgnore(String rule). Eclipse (or others, e.g. editor) could then manipulate the .gitignore files, and all the other ignore options and afterwards tells the IgnoreRules to re-initialise.
A second thing: Not looked at your code close enough, but I noticed that quite a few Eclipse plugins look at the subclipse when it comes to ignore handling, and try to 'hide' the ignore files from the user. I personally don't like that because the propset based ignore handling is a highly SVN specific thing. I prefer the way it's handled with the CVS plugin: show the .gitignore files to the user and even let him edit those files with an editor. As soon as we detect a change (even after a refresh if someone edited it with vi), we simply re-init our IgnoreRules.
WDYT?
Btw: Do you have a github account already? We could create an 'ignore' branch and I'm sure Jason can give you push rights to it. 

txs and LieGrue, strub

[1] http://github.com/sonatype/JGit/blob/ad8d1460919f1c5d34fff17a2ea54acea62e4107/org.spearce.jgit/src/org/spearce/jgit/ignore/IgnoreRules.java
--- Ferry Huberts <ferry.huberts@pelagic.nl> schrieb am Do, 26.3.2009:
Show 7 quoted lines
> Von: Ferry Huberts <ferry.huberts@pelagic.nl>
> Betreff: [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores
> An: git@vger.kernel.org
> CC: "Shawn O. Pearce" <spearce@spearce.org>, "Robin Rosenberg" <robin.rosenberg@dewire.com>, "Ferry Huberts" <ferry.huberts@pelagic.nl>
> Datum: Donnerstag, 26. März 2009, 22:34
> Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
> ---
[patch cutted]
      
Ferry Huberts (Pelagic)· May 2, 2009, 12:44 UTC · re: Mark Struberg · lore

Re: AW: [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores

Mark Struberg wrote:
Show 6 quoted lines
> Ferry,
> 
> I was just quickly hacking a rudimentary IgnoreRules class in jgit-core
> [1] mainly for the purpose of not forgetting about handling ignores
> finally ;)
> 

I think there is no need to do that, I have that in my code already (although in a different form). My implementation reflects what C git does.

> I now saw you worked on introducing gitignore to EGIT, but wasn't able
> to find any repo with your code but only a few old patches.
> 
it's in my local repo. I have no public repo
> Do you see a way we can move your work into jgit-core? I've seen you
> have a lot of Eclipse specific stuff in your code, so we'd obviously
> have to cut those things in slices.

I've been asking Shawn about input a few times but did not receive any yet. he wants it moved into a treewalk but I'm way too unfamiliar with that code to do it properly (and easily)

the reason that I have a lot of eclipse specific stuff in there is because I just started implementing the handling in the egit plugin since that was the easiest point to plug it into.

I have been thinking a lot about getting rid of the eclipse specific stuff and I think that's not hard. it requires a bit of reworking of the code but what I have in mind is actually a lot cleaner that what I sent out earlier.

> 
> One possible strategy would be to make the IgnoreRules stuff in
> jgit-core contain only the 'readonly' evaluation code, thus no
that would be easy
> addIgnore(File) and addIgnore(String rule). Eclipse (or others, e.g.
> editor) could then manipulate the .gitignore files, and all the other
> ignore options and afterwards tells the IgnoreRules to re-initialise.

I think it would be easier to let eclipse manipulate the ignore file and then just re-read it into the 'ignore cache'

Show 12 quoted lines
> 
> A second thing: Not looked at your code close enough, but I noticed
> that quite a few Eclipse plugins look at the subclipse when it comes to
> ignore handling, and try to 'hide' the ignore files from the user. I
> personally don't like that because the propset based ignore handling is
> a highly SVN specific thing. I prefer the way it's handled with the CVS
> plugin: show the .gitignore files to the user and even let him edit
> those files with an editor. As soon as we detect a change (even after a
> refresh if someone edited it with vi), we simply re-init our
> IgnoreRules.
> 1
> WDYT?

see remark above. exactly what I had in mind. git does ignore handling like cvs.

> 
> Btw: Do you have a github account already? We could create an 'ignore'
> branch and I'm sure Jason can give you push rights to it.
> 

no account yet. would be nice to work on this with other people.

Ferry
Robin Rosenberg· May 3, 2009, 13:17 UTC · re: Ferry Huberts (Pelagic) · lore

Re: AW: [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores

lördag 02 maj 2009 14:44:10 skrev "Ferry Huberts (Pelagic)" <ferry.huberts@pelagic.nl>:
Show 16 quoted lines
> Mark Struberg wrote:
> > Ferry,
> > 
> > I was just quickly hacking a rudimentary IgnoreRules class in jgit-core
> > [1] mainly for the purpose of not forgetting about handling ignores
> > finally ;)
> > 
> 
> I think there is no need to do that, I have that in my code already 
> (although in a different form). My implementation reflects what C git does.
> 
> > I now saw you worked on introducing gitignore to EGIT, but wasn't able
> > to find any repo with your code but only a few old patches.
> > 
> 
> it's in my local repo. I have no public repo

Perhaps you could send the patches if they are useful for review. I know Mark is anxious to get the patch train rolling.

If you do not want us to merge them yet add RFC to the subject prefix, though, I'm pretty sure we won't merge the first version anyway... Big or tricky patch sets rarely pass on the first attempt.

-- robin
Ferry Huberts (Pelagic)· May 3, 2009, 13:26 UTC · re: Robin Rosenberg · lore

Re: AW: [EGIT] [PATCH RFC v1 5/5] Use the ignore patterns cache to determine ignores

> 
> Perhaps you could send the patches if they are useful for review. I know Mark is anxious
> to get the patch train rolling.
> 

I think you missed it: I already sent out the patch train as an RFC. I got feedback from Shawn yesterday and am working on it now. I'm also anxious to get it in.

← back to recent threads