Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGIT check if entry matches gitignore rules
JGIT check if entry matches gitignore rules [message #1769210] Thu, 27 July 2017 19:30 Go to next message
harry rajan is currently offline harry rajanFriend
Messages: 6
Registered: October 2012
Junior Member
Hi,

I am using ObjectInserter and TreeFormatter apis to build a git repository as per this website (http://www.codeaffine.com/2014/10/20/git-internals/).

How do i check if a file entry matches the rules of gitignore/exclude files before inserting into the object database? I see IgnoreNode and FastIgnoreRules apis but these are constructed internally in the FileTreeIterator.

Thanks,
H
Re: JGIT check if entry matches gitignore rules [message #1769245 is a reply to message #1769210] Fri, 28 July 2017 07:59 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 252
Registered: July 2009
Senior Member
You are sure that you don't want a FileTreeIterator and a TreeWalk? Problem is that .gitignore files can exist in any folder of the working tree. And you have to interprete and merge together all gitignores you find in the current dir and in all dirs upon you (and is has to be merged with global .gitignores in $HOME, /etc/,...). That's why a computation of the effective gitignore rules is done inside a Walk and an WalkIterator.

The same is true for attributes. You have to compute effective set of gitattributes to compute e.g. whether a file should be treated as binary or cr/lf conversion has to be done.


Ciao
Chris
Previous Topic:How to fetch one commit by Jgit?
Next Topic:Super slow right click on branch in history window
Goto Forum:
  


Current Time: Wed Jun 20 09:32:20 GMT 2018

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

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

Back to the top