+5
Completed

Add support for Git includeIf.path option

Ricardo Amaral 6 years ago updated by Marc Strapetz 2 years ago 7

SmartGit does not Support includeIf.path introduced with Git v2.13 (released May 2017) and it’s ruining my workflow between my personal and work projects (I use the same laptop).

Using:

[include]
path = ~/.gitconfig-personal

Works just fine, but using:

[includeIf "gitdir/i:~/Workspace/**"]
path = ~/.gitconfig-personal

Does not work at all…

The .gitconfig-personal file includes my e-mail address and when I use SmartGit, since that file is not included when working with a repository inside ~/Workspace/, SmartGit complains of missing e-mail address.

This is a problem with SmartGit because although SmartGit complains about the missing e-mail address, I can still commit and my e-mail address will be added successfully to the commit by git.exe (because git.exe reads the includeIf directive properly, while SmartGit does not).

Also, please take into consideration that if you have a configuration like this:


.gitconfig


[user]
name = Ricardo Amaral
email = name@personal.com

[includeIf "gitdir/i:~/Workspace/Work/**"]
path = ~/.gitconfig-work


.gitconfig-work


[user]
email = name@work.com


The e-mail being used by Git for any folder outside of ~/Workspace/Work/ will be name@personal.com but any Git repository inside ~/Workspace/Work/ will use name@work.com. In other words, after parsing the full Git configuration (taking into consideration "include" and "includeIf" directives), the parameters that precedence (if found duplicates) are the ones on the bottom of the

I just discovered the git config includeIf and also that SmartGit still does not support it.

I almost always use SmartGit for git operations and being able to use includeIf in my global .gitconfig as described above would really help and prevent commits with the wrong email which has happened in the past.

Completed

Present for 22.1 for the new, built-in Git-Implementation (has to be enabled in the Preferences, Low-Level Properties, "experimental.gitimpl".

Hi, this was indeed working in 22.1 but I can't find it in 22.2.3 and the includeIf are not honored anymore. Was it removed?

SmartGit 22.1 is only in preview, SmartGit 22.2 not even started.

sorry, I meant 21.x but this feature wasn't present at all, was it? My little story : I reinstalled my laptop from scratch and this is not working although that was working before. So maybe I was already using v22 but I don't remember...

This feature is only supported since 22.1.