Skip to content

Add git-config include. #345

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 16 commits into from
Mar 28, 2022
Merged

Add git-config include. #345

merged 16 commits into from
Mar 28, 2022

Conversation

svetli-n
Copy link
Contributor

@svetli-n svetli-n commented Mar 5, 2022

@svetli-n
Copy link
Contributor Author

svetli-n commented Mar 5, 2022

@Byron plz take a look when taking a break from multithreading :-)

@Byron
Copy link
Member

Byron commented Mar 6, 2022

Thanks for taking a shot at this.

There seems to be an issue with the way commits/pushes are done - this is how it looks to me:

Screen Shot 2022-03-06 at 8 16 05 AM

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.

I took a look mostly at the tests this time, with a few general comments.

@svetli-n svetli-n marked this pull request as ready for review March 8, 2022 23:35
@svetli-n svetli-n changed the title Add git-config include for absolute paths. Add git-config include. Mar 9, 2022
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!

I think the biggest change still needed is to pass in context so interpolate(…) has something to work with.

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.

I really like seeing how this PR is developing, and includeIf is probably in reach now, too.

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 for the fixes!
Some more ideas came up, I think they may help prepare the code for includeIf as well.
My plan is to merge this one next time.

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.

I was about to prepare this PR for merging when I noticed one last thing that I couldn't fix in the little time that remained.

Once it is addressed I'd love to merge. Thanks.

@Byron
Copy link
Member

Byron commented Mar 19, 2022

So close :)!

When refactoring and looking at the code I noticed that it would by its very nature loose the include sections themselves. Maybe I am wrong about this, but could you add a test to assure that doesn't happen?

I double-checked with git config --get-all --includes include.path and could indeed query all values underneath the include sections themselves.

Thank you.

@Byron
Copy link
Member

Byron commented Mar 19, 2022

As discussed, two more small items on the list of the ever expanding scope.

  • allow to emulate something like '--no-include'
  • check if GIT_CONFIG_VALUES may contain include.path and have them followed, and if so, we'd need that too.

@Byron Byron mentioned this pull request Mar 20, 2022
24 tasks
@svetli-n
Copy link
Contributor Author

Ready may be? :-)

Byron and others added 4 commits March 27, 2022 17:36
It was born in the `from_paths()` method which eventually showed
that it wasn't possible to easily resolve paths in an existing
config file, as is the case in the `from_env()` constructor.

There still is a TODO asking how to resolve relative include paths
if there was no path on disk.
@Byron
Copy link
Member

Byron commented Mar 28, 2022

Thanks a lot for your contribution, it's merged!

Please note also about the comment in 3cbe072, I think it would be valuable to split tests into integration tests without affecting the API, and factor the unit tests out into their own module files (without being integration tests). Even though this refactoring could be done at any time, I recommend doing it before proceeding with includeIf support.

@Byron Byron merged commit 7fd8369 into GitoxideLabs:main Mar 28, 2022
@svetli-n
Copy link
Contributor Author

Awesome & thanks for the valuable guidance while working on it!

Yes, I was unsure about the tests and will act on the comment in 3cbe072

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.

2 participants