-
Notifications
You must be signed in to change notification settings - Fork 0
fix(install.sh): auto-run 'gh auth setup-git' so gist ops stop prompting #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -758,6 +758,21 @@ ensure_prereqs() { | |||||||||||||||||||||||||
| if ! gh auth status >/dev/null 2>&1; then | ||||||||||||||||||||||||||
| warn "gh CLI is not authenticated. Run once before 'airc join':" | ||||||||||||||||||||||||||
| warn " gh auth login -s gist" | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
| # Wire gh's token into git's credential helper. Without this, | ||||||||||||||||||||||||||
| # every git-over-HTTPS op (gist fetch/push -- airc's substrate | ||||||||||||||||||||||||||
| # hot path) prompts the user for a password, repeatedly. gh ships | ||||||||||||||||||||||||||
| # with `gh auth git-credential` for exactly this purpose; the | ||||||||||||||||||||||||||
| # `gh auth setup-git` one-liner registers it in ~/.gitconfig. | ||||||||||||||||||||||||||
| # Idempotent (no-op if already configured), safe to always run. | ||||||||||||||||||||||||||
| # Joel hit this on 2026-04-28 — Windows install where gh was | ||||||||||||||||||||||||||
| # auth'd-in-keyring but git itself didn't know. Resulted in a | ||||||||||||||||||||||||||
| # GUI password popup every airc operation that touched a gist. | ||||||||||||||||||||||||||
| if ! git config --global --get-all credential.https://github.com.helper 2>/dev/null | grep -q 'gh auth git-credential'; then | ||||||||||||||||||||||||||
| if gh auth setup-git 2>/dev/null; then | ||||||||||||||||||||||||||
| info " gh token wired into git credential helper (no more password popups for gist ops)" | ||||||||||||||||||||||||||
|
Comment on lines
+772
to
+773
|
||||||||||||||||||||||||||
| if gh auth setup-git 2>/dev/null; then | |
| info " gh token wired into git credential helper (no more password popups for gist ops)" | |
| setup_git_output="$(gh auth setup-git 2>&1)" || setup_git_status=$? | |
| if [ "${setup_git_status:-0}" -eq 0 ]; then | |
| info " gh token wired into git credential helper (no more password popups for gist ops)" | |
| else | |
| warn "Couldn't wire gh into git's credential helper automatically." | |
| if [ -n "$setup_git_output" ]; then | |
| warn "gh auth setup-git output: $setup_git_output" | |
| fi | |
| warn "Run manually to avoid GitHub password prompts for gist ops:" | |
| warn " gh auth setup-git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idempotency guard only checks
credential.https://github.com.helper, but airc also does rawgit clone https://gist.github.com/<id>.git(e.g.airc:1998), which uses thegist.github.comhost-specific credential key. If a user already has a helper configured for github.com but not for gist.github.com, this guard will skipgh auth setup-gitand gist HTTPS ops may still prompt. Consider checking bothcredential.https://github.com.helperandcredential.https://gist.github.com.helperforgh auth git-credential, or drop the guard and rely ongh auth setup-git’s own idempotency.