implement category priorities#32
Open
marinjurjevic wants to merge 1 commit into
Open
Conversation
402ae9f to
776d71c
Compare
776d71c to
02c49b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR introduces category priorities. This can be useful when you need to override a common tool setting with machine specific setting. In general, it allows a way to make category take precedence by listing it after another category.
Most people use
dotgit restorewithout explicit category, wherecommonandhostnamecategories are implicitly added.commoncategory has lowest priority because it's added first.hostnamecategory has highest priority because it is appended last.For example:
Both of these file configs cause error.
First one is problematic when restoring without explicit category.
Second one fails in similar manner.
Implementation
Categories are prioritized based on their order after category list is flattened during activation. This allows fine tuning configurations and having general configs overriden by specific configs.
DISCLAIMER: Code and tests have been generated by AI agent. I've added a sentence do docs more as a placeholder. Maybe cookbook could be expanded with more examples and with more complex
filelistexamples.