Re: Feature request: partial URL matching for credential config
From: M Hickford <hidden>
Date: 2025-09-30 19:00:17
On Tue, 30 Sept 2025 at 16:03, brian m. carlson [off-list ref] wrote:
On 2025-09-27 at 18:48:46, M Hickford wrote:quoted
Any thoughts on adding support for URL prefix matching? Example syntax could be credential.https://example.com/org1/*.key (explicit wildcard) or credential.https://example.com/org1/.key (implicit wildcard)I think I may have added support for this (using the urlmatch patterns) but didn't document it[0]. I see some tests for it in t0300. Have you tried it?
Thanks Brian for your reply. You're right, it already works as desired:
$ git -c credential.https://example.com/org.username=bingo config
get --url=https://example.com/org/repo.git credential.username
bingo
It has to be a path prefix, not just a string prefix, which is nice:
$ git -c credential.https://example.com/org.username=bingo config
get --url=https://example.com/organ/repo.git credential.username
Regardless, I believe it's a useful feature that we should have. If, perchance, I did add it and it's still around, would you be willing to write some documentation for it?
I shall send a patch with documentation and expanded tests.
[0] I believe Dscho graciously helped fix a few bugs in my changes, which I appreciate. -- brian m. carlson (they/them) Toronto, Ontario, CA