Skip to content

Automatically close tab after 5 seconds - #95

Open
nicholasdille wants to merge 12 commits into
hickford:mainfrom
nicholasdille:autoclose
Open

Automatically close tab after 5 seconds#95
nicholasdille wants to merge 12 commits into
hickford:mainfrom
nicholasdille:autoclose

Conversation

@nicholasdille

@nicholasdille nicholasdille commented Oct 16, 2025

Copy link
Copy Markdown

This change automatically closes the tab after 5 seconds. This is just for convenience.

@google-cla

google-cla Bot commented Oct 16, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@hickford

Copy link
Copy Markdown
Owner

Thanks for sharing

With many git repositories, git-credential-oauth opens many browser tabs

That's unexpected, unless each repository has a different user or host. What's your config? git config --get-all credential.helper

@nicholasdille

Copy link
Copy Markdown
Author

My git configuration is a bit more elaborated. I have multiple includeIf and credential blocks. But it only happens for gitlab.my-company.com. Does this help?

$ cat ~/.gitconfig
[push]
	default = simple
	autoSetupRemote = true
	followTags = true
[user]
	name = Nicholas Dille
[init]
	defaultBranch = main
[tag]
	sort = version:refname
[diff]
	algorithm = histogram
	colorMoved = plain
	mnemonicPrefix = true
	renames = true
[fetch]
	prune = true
	pruneTags = true
	all = true
[merge]
	conflictstyle = zdiff3
[pull]
	rebase = true

[includeIf "hasconfig:remote.*.url:https://gitlab.my-company.com/**"]
    path = .gitconfig-haufe

[credential "https://gitlab.my-company.com"]
    helper = cache --timeout 21600
    helper = oauth
    oauthclientId = "[REDACTED]"
    oauthScopes = "read_repository write_repository"
    oauthAuthURL = /oauth/authorize
    oauthTokenURL = /oauth/token
    oauthDeviceAuthURL = /oauth/authorize_device

@hickford

Copy link
Copy Markdown
Owner

Curious. I'd expect at most one tab opened in six hours (21600 seconds).

Try #77 (comment)

Try this troubleshooting section https://github.com/hickford/git-credential-oauth/blob/main/README.md#troubleshooting

and debugging https://github.com/hickford/git-credential-oauth/blob/main/README.md#debugging

@nicholasdille

Copy link
Copy Markdown
Author

This is really weird. I tried simplifying my git config but could not get rid of the multiple tabs. I wonder if this is rather related to vscode which performs git fetch on all repos regularly. I will do some more tests and get back to you.

Thanks for your support!

BTW, I love this project. Great work!

@hickford

Copy link
Copy Markdown
Owner

What platform and Git version are you using?

@nicholasdille

Copy link
Copy Markdown
Author

I am on WSL (Windows 11) with git 2.51.0.

If I visit multiple git repositories and run git fetch on the console individually, I only get a tab once. It looks like vscode is running git commands on repositories at once. I'll do some more testing.

@hickford

hickford commented Jan 15, 2026

Copy link
Copy Markdown
Owner

So you have Git installed inside WSL as well as Git for Windows outside? That's typical but check both configurations.

VSCode installed in Windows presumably? Then it would use Git for Windows.

@nicholasdille

Copy link
Copy Markdown
Author

I am using VSCode with the WSL extension so the server side component is running in WSL and all git commands are executed in WSL.

I am sure that it is related to git.autofetch in vscode. Once I switched it off and used the UI to fetch from the repos one after another, it worked as expected. It seems to be related to the fact, that the autofetch feature updates all repositories at the same time.

Thanks for your support.

The reason for this PR has changed. It is now more of a luxury feature if the tab goes away automatically. cosign does this for example. I'll update the description.

ccmtaylor and others added 10 commits January 16, 2026 14:31
the call site in main() exits on error, so this seems unnecessary here
use package rsc.io/qr to generate QR codes and display them in the
terminal using ANSI escape codes.
github gists under gist.github.com are just git repos that share
the same auth infrastructure as the normal github.com instance,
so we can just reuse the existing github.com configuration there
as github gists use the normal github endpoints they should be excampt
of the domain matching test
Couple of preallocations for maps that can be done, plus making `template` a `const`
@ifireball

Copy link
Copy Markdown

@hickford is there a chance this will get merged? If not, are there other ways to establish this kind of functionality you will be willing to accept (E.g, a config variable to customize the page template)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants