[Please keep the list in CC so others can chime in.] On 2024-05-03 at 23:41:14, Simon Thurston wrote: > Thanks Brian. The issue I'm having is that I have two main development directories, for "home" and for "work". I have includeIf statements in my primary .gitconfig that sources different public/private keys for each subdirectory. Under the "work" subdirectory, I have folders for projects, and then a "Deploy" folder that contains symlinks to folders over the network, so I can quickly cd and git clone/pull to deploy things manually, as well as use with some CD powershell scripts I have. The important thing to note is that the directories that are symlinked to repositories. > > In short, if I have an includeIf that encompasses a parent directory, any subdirectory symlink that points to a repository on a local server does not properly resolve to include the settings from the includeIf. > > /work/Project/.git can be detected, but /work/Deploy/ProjectSymlink/.git cannot, and thus any includeIf statement that checks for repositories under /work/** does not properly detect the repositories that are symlinked. Yes, I think this is intentional. Git doesn't consider the repositories which are on the UNC drive to be under /work/Deploy, because the canonical path is not in that location. > I have tried to get around this by adding an extra includeIf statement to include //the/direct/unc/path/** but that was not able to resolve properly either. Mapped network drives with drive letters also don't resolve, and the only workaround I had was to blanket apply the config file to every directory, which is not ideal for the environment I work in. Yes, the mapped network drives will be resolved to the UNC path with `GetPathNameByHandle`, which is why that syntax doesn't work. > If the behavior around symlinks is intentional, then that is fine and can be worked around, but not being able to specify UNC style paths in the configs is something that makes it difficult to work on SMB shares with specific configs needed. As I said, I don't use Windows except extremely incidentally, so it's difficult for me to speak with any authority on UNC paths. It's possible that they are supported using a syntax I don't know about, or it's possible that they simply don't work at all. If it's the latter, I'm sure we'd accept a patch to fix it. What I might suggest is switching into one of the symlinked directories and running `git rev-parse --absolute-git-dir`, which should show you what Git thinks the directory is. You can then write that path directly in the configuration file, nothing that inside the double quotes, backslashes must be escaped (so if the path is \\the\direct\unc\path, you'd write '[includeIf "\\\\the\\direct\\unc\\path"]'). You may also want to use gitdir/i if you're not already, since my guess is that your paths are actually case-insensitive. If that doesn't work, hopefully someone else more familiar than me with Windows can speak more to this. -- brian m. carlson (they/them or he/him) Toronto, Ontario, CA
Attachment:
signature.asc
Description: PGP signature