Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 7 commits into from
Apr 23, 2013

Conversation

arrbee
Copy link
Member

@arrbee arrbee commented Apr 22, 2013

  • move more core.xyz config options into the repository config cache
  • update code to the the config cache
  • improve config cache invalidation
  • support more configs in the diff code (e.g. diff.context)
  • test more diff config settings

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...

  1. I made it so that git_config_refresh() and git_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.
  2. I made it so that tree to tree diffs are done using case sensitive ordering even on a platform that has a case insensitive filesystem. When the case insensitive tree iterator was added, we started using the sort order of the index file to decide sort order for tree iterators, but for tree-to-tree comparison, I feel like there is no reason to do that. (This change is only part of this PR because I was changing how repo flags are initialized and happened to notice this issue.)

@vmg
Copy link
Member

vmg commented Apr 23, 2013

Segfault in Travis! That's weird. @arrbee can you give it a look?

@yorah
Copy link
Contributor

yorah commented Apr 23, 2013

I made it so that tree to tree diffs are done using case sensitive ordering even on a platform that has a case insensitive filesystem

I believe this may fix libgit2/libgit2sharp#365. I will test when it gets merged.

@arrbee
Copy link
Member Author

arrbee commented Apr 23, 2013

Segfault in Travis! That's weird. @arrbee can you give it a look?

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.

linquize and others added 7 commits April 23, 2013 12:57
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.
@arrbee
Copy link
Member Author

arrbee commented Apr 23, 2013

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...

@vmg
Copy link
Member

vmg commented Apr 23, 2013

Cool. Thank you @arrbee!

vmg pushed a commit that referenced this pull request Apr 23, 2013
Support more diff config options and use the config cache more
@vmg vmg merged commit 2370b4d into libgit2:development Apr 23, 2013
@arrbee arrbee deleted the fix-diff-config-usage branch April 23, 2013 20:38
@yorah
Copy link
Contributor

yorah commented Apr 26, 2013

I will test when it gets merged.

Done. This partially fixes libgit2/libgit2sharp#365 (see explanation there).

phatblat pushed a commit to phatblat/libgit2 that referenced this pull request Sep 13, 2014
Support more diff config options and use the config cache more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants