-
-
Notifications
You must be signed in to change notification settings - Fork 346
feat(git-config): add GitConfig::from_paths
#225
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
feat(git-config): add GitConfig::from_paths
#225
Conversation
Intent here is to follow-up with a As far as I understood multi-values, the following will be true as it is up to the caller to decide if they want sample all sections or just a single section:
PTAL @edward-shen 🙂 |
Thanks for the PR! Re: multivar behavior: can you run/add a test that includes sections with the same key? I'd like to document that behavior in our tests. Honestly that wording from the git-config doc is a little ambiguous. Can you also model a test after the behavior of |
Yeah it is, I interpreted it as collapsing at first but came around about 15 minutes later. It will return all values across sections and files (say Did you have anything specific in mind for said test tho @edward-shen? 🙂 |
Digging into it little bit more, seems that git-config calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not particularly! I just want to have this behavior documented somewhere in the code, so if there was a difference in behavior from git-config
then I just wanted a test to make sure it was noted. Since git-config is doing the same, there's no real reason to add a test (although adding a comment saying this matches the behavior of git-config
would be nice while you clean up the potential lints).
If you have a quick sec I'd appreciate fixing the lints before merging, but not going to block you on that if you don't.
Again, thanks for the PR :)
Oops, had assumed CI would catch that. |
Let me know if you'd like another review for docs, but otherwise the newly added docs looks good as is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, looks great to me, too.
This adds
GitConfig::from_paths
which constructs a config from all the sections of the given files.Sections are additive so that multi-value semantics are preserved.
Towards #191