forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: support remote name in includeIf.hasconfig condition
includeIf.hasconfig only accepts remote.*.url, making it difficult to apply configuration based on a specific remote, especially in projects with multiple remotes (e.g., GitHub and non-GitHub hosting). This often leads to undesired application of multiple config files. For example, the following configuration: [remote "origin"] url = https://git.kernel.org/pub/scm/git/git.git [remote "github"] url = https://github.com/myfork/git.git [includeIf "hasconfig:remote.*.url:https://github.com/**"] path = github.inc [includeIf "hasconfig:remote.*.url:https://git.kernel.org/**"] path = git.inc would apply both github.inc and git.inc, even when only one config is intended for the repository. Introduce support for specifying a remote name (e.g., origin) to enable more precise configuration management: [includeIf "hasconfig:remote.origin.url:https://github.com/**"] path = github.inc [includeIf "hasconfig:remote.origin.url:https://git.kernel.org/**"] path = git.inc This ensures that only git.inc is included in this configuration while other repositories that use github.com for origin can only include github.inc. Signed-off-by: Ken Matsui <ken@kmatsui.me> Signed-off-by: Taylor Blau <me@ttaylorr.com>
- Loading branch information
1 parent
34b6ce9
commit ed573c4
Showing
3 changed files
with
219 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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