Subject: Re: [PATCH] http.c: prompt for username on 403

From: "brian m. carlson" <[email-masked]>
Date: Wed, 10 Dec 2025 22:28:20 +0000

On 2025-12-10 at 12:30:27, Ashlesh Gawande wrote:
> Oh, that http_code == 403 is my original proposal to prompt for
> username/password on 403 (I did the diff on top of that instead of base).
> But you pointed out that it would wipe out existing credentials. This is an
> attempt to fix that by not prompting on 403 if git credentials are set.
> So when credentials are provided through default netrc file (such that
> http_auth.* are not set; git credential helper is not set) then we can still
> get the prompt on 403.

As Randall said, I don't think it's a good idea to do this.  It's a
major change in how functionality works and it will probably break
users.

I did mention before that a better approach is to add a config to decide
whether to honour the netrc and I think that would be the right choice
here.  That lets people opt into different behaviour if they want it
(and, to be honest, I _do_ very much want to skip netrc for Git
credentials since I have similar problems as the ones you're describing)
and avoids breaking things for existing users.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA