On Mon, Jun 30, 2025 at 02:31:15PM +0000, brian m. carlson wrote: > On 2025-06-30 at 13:45:30, Michal Suchánek wrote: > > I was trying out AGit https://docs.gitea.com/usage/agit with oauth > > helper https://github.com/hickford/git-credential-oauth encountering > > this bug https://github.com/go-gitea/gitea/issues/34583 > > > > When doing so the oauth helper asked for new authentication, then for > > some reason I was asked for authentication by some other helper. > > > > After that pushing to repository to which I have permissions asked for > > authentication again. > > > > This hints that any failed git operation erases helper credentials. > > This is true and it's by design. > > > That does not sound like a desirable behavior. > > It is in fact desirable because otherwise the user continues to attempt > to use the bad credentials and then can never again authenticate > successfully, since they are never again prompted for credentials. My proglem is that the credentials are actually valid, only the operation is not. The current behavior erases valid credentials. > > Could the previous credentials be preserved? > > Git doesn't have a behaviour to do so, but you could of course craft a > custom credential helper that just rejects the erase command and passes > everything else through to another helper. That would achieve your I do not want to use another helper. I want to preserve the last valid credentials. Of course, using credentials that are not maintained by git at all (such as ssh authentication) does not have this problem. Only git-managed credentials get erased on invalid operation. Thanks Michal