How can I suppress or resolve "info: detecting host provider for..." in Git?
Asked Answered
F

1

20

I'm getting the following output when executing a fetch / pull via a powershell script:

info: detecting host provider for '[devops site address]'...

Normally, this wouldn't be an issue, however, Azure DevOps sees this output as an error and labels the release stage as such. Is there a way I can either suppress this output, or resolve it via GIT?

The remote location for the repository is an on-prem version of DevOps.

Thanks!

Forcemeat answered 22/10, 2021 at 18:16 Comment(5)
This doesn't come from Git, so it must come from something sitting between Git and the azure devops part. That, or azure devops is confused by its own messages... You'll probably be best served by finding out if there's some sort of man-in-the-middle here that's doing this "host provider" detecting before you proceed.Vouchsafe
I started getting this too and I don't use Azure DevOps. I just updated to Git for Windows 2.33.1.windows.1.Gooch
@Vouchsafe Sorry, for the late reply. In my limited research, it looks like powershell dumps output to the stderr io stream by default. DevOps is treating this an an error, rightfully so. It also seems like this is likely from GIT. If I run a fetch command through the command line, I'm seeing it. Unfortunately, it doesn't seem like this new output is hidden when running commands quietly. Now I'm in a battle with DevOps trying to reroute the output away from stderr to a file with 2>git_output.file, or 2>&1. Both work when running my powershell locally. Probably something permissions related.Forcemeat
@AlbertSzilvasy This is the same version I am running. Glad to hear it isn't just me lol.Forcemeat
The string doesn't appear anywhere in the Git source, but it might be in some library that Git uses (e.g., libcurl). ... Aha, it appears to be in the (Microsoft-provided) Git Credential Manager Core thingy. See here and here.Vouchsafe
R
18

This comes indeed from the GCM used by Git.
You can either downgrade to Git 2.32, or wait for the recently released Git-Credential-Manager-Core v2.0.603, which does remove those messages.

Said release is not yet packaged with the latest Git for Windows, like the recent 2.34.0, but expect it in 2.34.1.

A set GCM_PROVIDER=generic could help too.


Update Nov. 25th, 2021: Git for Windows 2.34.1 has been released, and it does include Git Credential Manager Core v2.0.605.12951.

That GCM 2.0.605 includes "Remove noisy messages during auto-detection" (#492, #494).

Rato answered 16/11, 2021 at 16:39 Comment(9)
GCM 2.0.605 is indeed in 2.34.1Assuntaassur
@Étienne Great news! I have edited the answer to include the reference to the new Git and GCM releases.Rato
I am still seeing the issue in 2.34.1.Figge
I can confirm github.com/git-for-windows/git/releases/tag/v2.33.0.windows.2 is working as expected. I did not test any other versions.Figge
@Figge Strange. I don't see the message in 2.34.1Rato
I just upgraded to 2.34.1 and I still see this messageIrritate
@GaganTK Strange. I have git version 2.34.1.windows.1, and I don't see it anymore.Rato
Apologies for the delayed accepted answer. This was helpful and I appreciate you following up with the link.Forcemeat
@Forcemeat No problem. Glad this answer was helpful.Rato

© 2022 - 2024 — McMap. All rights reserved.