milke / GitFinder-Issues

Bug and issue tracker for GitFinder - git client with macOS Finder integration
16 stars 1 forks source link

Cannot use gitconfig include directive with symlinks #109

Closed tosie closed 2 years ago

tosie commented 2 years ago

I am using the include directive in my .gitconfig to have different sets of config options for different types of machines like this:

[includeIf "gitdir/i:/Users/"]
  path = .gitconfig-macos

[includeIf "gitdir/i:C:/"]
  path = .gitconfig-windows

[includeIf "gitdir/i:/"]
  path = .gitconfig-linux

[include]
  path = .gitconfig.local

Some of the included files are symlinked like this:

.gitconfig         -> $HOME/.dotfiles/git/gitconfig.symlink
.gitconfig-linux   -> $HOME/.dotfiles/git/gitconfig-linux.symlink
.gitconfig-macos   -> $HOME/.dotfiles/git/gitconfig-macos.symlink
.gitconfig-windows -> $HOME/.dotfiles/git/gitconfig-windows.symlink
.gitconfig.local

When starting GitFinder, this message is shown:

screenshot1

The includes settings look like this:

screenshot2

Now when trying to match a file by selecting the symlink -- which is the only correct file path that matches the include directive -- this error message is shown:

screenshot3

Is there any way to use symlinked .gitconfig-includes?

milke commented 2 years ago

@tosie, we can call it a bug, I haven't predicted the case of included files being symlinks to other files.

Anyway, I've fixed it (I believe) in the latest beta build, which I've just uploaded. It's version 1.7.5b1 (build 119) and you can download it directly here, but you can also update your current copy to it automatically, just select Beta update channel in the preferences, like in the picture below:

Screen Shot 2021-11-18 at 20 02 09

This version should handle included symlinks correctly, but just be aware that, when reporting included files, GitFinder will not report symlinks defined in config file(s), it will report symlinked targets instead, like for example in the pictures below:

Screen Shot 2021-11-18 at 18 43 09 Screen Shot 2021-11-18 at 18 43 19

You probably realise selecting included files is necessary to include them in GitFinder sandbox environment (GitFinder is fully sandboxed application).

Please try this beta build and let me know if it solves your problem.

milke commented 2 years ago

@tosie, any luck with the latest beta?

tosie commented 2 years ago

I am so sorry ... just today I came back to my mac and what can I say: It works fine. Thank you very much for the quick update!