git-ecosystem/git-credential-manager

Please add support for [includeif "hasconfig:remote.*.url:..."]

ktetzlaff opened this issue · 3 comments

I have moved site specific credential options like

[credential "https://git.example.com"]
        username = ...
	provider = generic

to a separate file which is included in my global git config via [includeif "hasconfig:remote.*.url:https://git.example.com/**"]. Unfortunately, GCM doesn't (seem to) properly handle the hasconfig:remote.*.url: includeif variant and thus doesn't find my credential config. It then decides to add its own:

[credential "https://git.example.com"]
	provider = generic

section to the global git config.

If supporting the includeif mechanism is not possible, please provide an option to stop GCM from automatically updating git config files (I manage my config via chezmoi which detects and complains about the local change made by GCM each time I update my dotfiles).

Unfortunately, GCM doesn't (seem to) properly handle the hasconfig:remote.*.url: includeif variant

Git Credential Manager asks git config to do the honors, so if your git executable cannot handle that includeif construct, that would explain things. Otherwise, please feel free to generate and analyze a trace by using GCM_TRACE=1.

Thanks for checking!

I just retested this with GCM 2.5.0 and git 2.43.0 and could not reproduce the problem. Unfortunately, I did not report the versions I used when opening the issue. Based on the date, it should have been GCM 2.4.1. But even with that version, GCM works as expected.

So I'm closing the issue. Sorry for the noise...

Otimo emulador ps3