Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Apr 28, 2026

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 raw git clone https://gist.github.com/<id>.git (e.g. airc:1998), which uses the gist.github.com host-specific credential key. If a user already has a helper configured for github.com but not for gist.github.com, this guard will skip gh auth setup-git and gist HTTPS ops may still prompt. Consider checking both credential.https://github.com.helper and credential.https://gist.github.com.helper for gh auth git-credential, or drop the guard and rely on gh auth setup-git’s own idempotency.

Suggested change
if ! git config --global --get-all credential.https://github.com.helper 2>/dev/null | grep -q 'gh auth git-credential'; then
# Check both github.com and gist.github.com host-specific helpers:
# airc uses gist HTTPS URLs directly, and Git may consult the
# gist.github.com-scoped credential key separately from github.com.
if ! git config --global --get-all credential.https://github.com.helper 2>/dev/null | grep -q 'gh auth git-credential' || \
! git config --global --get-all credential.https://gist.github.com.helper 2>/dev/null | grep -q 'gh auth git-credential'; then

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh auth setup-git failures are completely silenced (2>/dev/null) and there’s no warning path, so the installer can leave users in the original “password popup” state without any clue why. Suggest capturing stderr (or at least emitting a warn on non-zero) with a hint to run gh auth setup-git manually.

Suggested change
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"

Copilot uses AI. Check for mistakes.
fi
fi
fi
fi
}
Expand Down
Loading