git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] config: support remote name in includeIf.hasconfig condition

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Oct 20, 2024, 16:21 UTC
Message-ID
<086ff955-bcdf-4aba-b6d4-c87f6fc6a724@ramsayjones.plus.com>
In-Reply-To
<20241020160143.92382-2-ken@kmatsui.me>
On 20/10/2024 17:01, Ken Matsui wrote:
Show 30 quoted lines
> Changes in v2:
> 
> * Updated the description based on Kristoffer's review.
> 
> -- >8 --
> 
> 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/**"]
s/remote.origin.url/remote.github.url/ ?
I haven't actually read the patch, so take with a pinch of salt. :)
Show 7 quoted lines
>     path = github.inc
>   [includeIf "hasconfig:remote.origin.url:https://git.kernel.org/**"]
>     path = git.inc
> 
> This ensures that only the intended config file is applied based on the
> specific remote.
> 

ATB, Ramsay Jones

Previous: Ken MatsuiNext: Ken Matsui
Message 5 of 10 in “config: support remote name in includeIf.hasconfig condition”
  1. config: support remote name in includeIf.hasconfig conditionKen Matsui, Oct 20, 2024
  2. Kristoffer HaugsbakkOct 20, 2024
  3. Ken MatsuiOct 20, 2024
  4. config: support remote name in includeIf.hasconfig conditionKen Matsui, Oct 20, 2024
  5. Ramsay JonesOct 20, 2024
  6. Ken MatsuiOct 20, 2024
  7. Ken MatsuiOct 20, 2024
  8. config: support remote name in includeIf.hasconfig conditionKen Matsui, Oct 20, 2024
  9. Ken MatsuiNov 6, 2024
  10. Junio C HamanoDec 3, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.