-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Support more diff config options and use the config cache more #1499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Segfault in Travis! That's weird. @arrbee can you give it a look? |
I believe this may fix libgit2/libgit2sharp#365. I will test when it gets merged. |
This is pretty odd. I rebased to pick up the latest changes from development just now, and I seem to be getting a failing test. |
When case insensitive tree iterators were added, we started reading the case sensitivity of the index to decide if the tree should be case sensitive. This is good for index-to-tree comparisons, but for tree-to-tree comparisons, we should really default to doing a case sensitive comparison unless the user really wants otherwise.
This adds a bunch of additional config values to the repository config value cache and makes it easier to add a simple boolean config without creating enum values for each possible setting. Also, this fixes a bug in git_config_refresh where the config cache was not being cleared which could lead to potential incorrect values. The work to start using the new cached configs will come in the next couple of commits...
This converts many of the config lookups that are done around the library to use the repository config cache. This was everything I could find that wasn't part of diff (which requires a larger fix).
This is a conservative change, but it seemed like the only safe thing to do -- i.e. clear the cvar cache when a config gets set.
This makes diff use the cvar cache for config options where possible, and also adds support for a number of other config options to diff including "diff.context", "diff.ignoreSubmodules", "diff.noprefix", "diff.mnemonicprefix", and "core.abbrev". To make this natural, this involved a rearrangement of the code that allocates the diff object vs. the code that initializes it based on the combination of options passed in by the user and read from the config. This commit includes tests for most of these new options as well.
Okay, I rebased to get the latest fixes from development and force pushed. Let's see if that fixes the Travis crash. It may not, but I can repro the problem on my local machine... |
Cool. Thank you @arrbee! |
Support more diff config options and use the config cache more
Done. This partially fixes libgit2/libgit2sharp#365 (see explanation there). |
Support more diff config options and use the config cache more
core.xyz
config options into the repository config cachediff.context
)This PR includes the work by @linquize from #1483
Apart from adding more values to the config cache and supporting more new config settings in the diff code, this PR contains two "fixes" that people may have an opinion about...
git_config_refresh()
andgit_config_set_...()
both will clear the repository config cache. Since more config settings are coming out of the cache, that seemed like the right thing to do, but I blast the whole cache every time, so it is pretty blunt.