Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Fix EOL issue using .gitattributes and git config without performance drawback

Here are my personal thoughts on this: I don't think we should start
promising "transactional" behavior with regards to reading the git
config files and attributes. We are working on a file system and have
to read multiple files to compute the effective configuration and
attributes - that will not be possible in a transactional fashion. If
during a long status operation in somebody changes the git config or
the attributes the outcome is undefined. Up to now I haven't heard
that this is a big problem for JGit users.

A different aspect is performance. I completely agree to you that long
term operations like a TreeWalk we should not expect that the config
or attributes will change during the runtime of the operation. If we
read a config or attributes file once in such operations we should
cache it. But to achieve that I would simply check that we don't
access files twice during one treewalk. I wouldn't start caching
config files/attributes whenever we start a high-level JGit API
command. In order to make use of the cached data from the
org.eclipse.jgit.api layer in all the low level operations we would
have to change the API of the low-level functions in order to accept
cached config data.

My suggestion would be to focus on TreeWalk and avoid multiple reads
to config/attributes.


Back to the top