Skip to content

Global ConfigParser #950

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Oct 28, 2019
Merged

Conversation

benthayer
Copy link
Contributor

fixes #775

We can instantiate a GitConfigParser with no files specified, if we do so, then it'll figure out where those files are. It does this by either having a config_level specified to it or, in the case of a config reader, by default we might want to read from all configuration levels, just like is currently the case in Repo.config_writer(), so we iterate through all of them (except repository level) and add all files to the parser.

If the repository level is specified, we raise a unique ValueError telling the user to use the Repo object instead.

@codecov-io
Copy link

Codecov Report

Merging #950 into master will decrease coverage by 0.01%.
The diff coverage is 22.72%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #950      +/-   ##
=========================================
- Coverage   93.52%   93.5%   -0.02%     
=========================================
  Files          59      59              
  Lines        9677    9915     +238     
=========================================
+ Hits         9050    9271     +221     
- Misses        627     644      +17
Impacted Files Coverage Δ
git/config.py 88.4% <22.72%> (-3.87%) ⬇️
git/objects/blob.py 100% <0%> (ø) ⬆️
git/refs/remote.py 100% <0%> (ø) ⬆️
git/test/test_diff.py 100% <0%> (ø) ⬆️
git/test/performance/test_streams.py 100% <0%> (ø) ⬆️
git/test/test_tree.py 100% <0%> (ø) ⬆️
git/test/test_exc.py 100% <0%> (ø) ⬆️
git/test/test_docs.py 99.6% <0%> (ø) ⬆️
git/test/test_refs.py 99.18% <0%> (ø) ⬆️
git/test/test_config.py 98.8% <0%> (ø) ⬆️
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfa0eac...d6c4415. Read the comment docs.

@Byron Byron added this to the v3.0.5 - Bugfixes milestone Oct 24, 2019
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution, it's looking great! I particularly like that the change is implemented without breaking compatibility.

There are just two minor things I saw when reviewing, please let me know what you think about them.

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your effort! It's a great improvement!

@Byron Byron merged commit 87a103d into gitpython-developers:master Oct 28, 2019
@benthayer
Copy link
Contributor Author

Happy to help!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Reading and writing global configuration parameters
3 participants