Open beeequeue opened 2 years ago
I have this problem too.
Versions:
2076
2.37.3.windows.1
Conditional configs are set like this:
[includeIf "gitdir/i:d:/code/"]
path = .gitconfig-retif
[includeIf "gitdir/i:d:/work/"]
path = .gitconfig-work
Where all the configs are located:
c:\Documents and Settings\retif\.gitconfig
c:\Documents and Settings\retif\.gitconfig-work
c:\Documents and Settings\retif\.gitconfig-retif
And git config --list --show-origin
executed inside a repository does report that correct [user]
credentials are fetched from the corresponding conditional config.
Sadly, Sublime Merge doesn't get those:
I'm also seeing this exact same issue under Windows on Sublime Merge 2079
It looks like other configs such as [http] are functioning correctly. But perhaps that's just because they're picked up directly by git. I too see the expected name/email from the conditional config when using git config --list --show-origin
. But when I try to commit in Sublime Merge I get the Edit User dialog box.
I've been doing some experimenting and have identified a work around. Adding a dummy name and password before the conditional statements keeps Sublime Merge happy and it will let you commit. When the commit is carried out by git, the correct name and email are obtained using the conditional statements. When drafting your commit it will say - <-> but once its committed the correct details will be down for the Author.
[user]
email = -
name = -
[includeIf "gitdir/i:C:/git/personal/"]
path = C:/git/.gitconfig-personal
[includeIf "gitdir/i:C:/git/work/"]
path = C:/git/.gitconfig-work
Version info
Description
I'm using conditional git configs for my work directories, but it seems like they aren't working at all.
I found the other issue (#502) and trying their reproduction does not work for me.
Steps to reproduce
Steps to reproduce the behavior:
C:\Users\user\.gitconfig
git --list --show-origin
in a git repo insidework
work
folderExpected behavior
Merge to resolve the same user settings as git does
Extras
git config --list --show-origin
``` ... file:C:/Users/bq/.gitconfig include.path=C:/Users/bq/.gitconfig.default file:C:/Users/bq/.gitconfig.default user.name=Adam file:C:/Users/bq/.gitconfig.default user.email=adam@haglund.dev file:C:/Users/bq/.gitconfig includeif.gitdir:C:/dev/izettle/.path=C:/dev/izettle/.gitconfig file:C:/dev/izettle/.gitconfig user.name=Adam Haglund file:C:/dev/izettle/.gitconfig user.email=ahaglund@paypal.com ... ```