On Fri, 5 Dec 2025 20:14:25 GMT, Francisco Ferrari Bihurriet
<[email protected]> wrote:
>> Git behaves as C, it doesn't resolve symlinks:
>>
>>
>> # Backup user's config and prepare git config files
>> mv ~/.gitconfig{,.bak}
>>
>> cat >/tmp/main.config <<'EOF'
>> [include]
>> path = included.config
>> EOF
>>
>> cat >/tmp/included.config <<'EOF'
>> [section]
>> key = "/tmp/included.config was included"
>> EOF
>>
>> cat >~/included.config <<'EOF'
>> [section]
>> key = "~/included.config was included"
>> EOF
>>
>> # Link ~/.gitconfig -> /tmp/main.config
>> ln -s /tmp/main.config ~/.gitconfig
>>
>> # Check which file is included (ensure CWD is anything else)
>> git -C / config section.key
>>
>> # Cleanup and restore user's config
>> rm ~/.gitconfig ~/included.config /tmp/included.config /tmp/main.config
>> mv ~/.gitconfig{.bak,}
>>
>>
>> Output:
>>
>> ~/included.config was included
>
> OpenSSL deals with relative paths differently, [they resolve against the
> application's
> CWD](https://www.openssl.org/docs/man1.1.1/man5/config.html#:~:text=Relative%20paths,as%20expected%2e):
>> Relative paths are evaluated based on the application current working
>> directory so unless the configuration file containing the `.include`
>> directive is application specific the inclusion will not work as expected.
OpenSSH [defines to possible base paths for relative `Include`
keywords](https://man7.org/linux/man-pages/man5/ssh_config.5.html#Include:~:text=Files%20without%20absolute%20paths,system%20configuration%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20file%2e):
> Files without absolute paths are assumed to be in `~/.ssh` if included in a
> user configuration file or `/etc/ssh` if included from the system
> configuration file.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24465#discussion_r2593913876