Skip to content

setup-project.py: the credential-helper check says store and every other helper "answer git's question for github.com" and counts any helper as configured, though one holding nothing answers nothing, so setup is silent on a push with no login #992

Description

@brettheap

Goal: setup-project.py's credential-helper check says only what is true of a helper that keeps logins (store): it answers git's question for github.com once a login is stored in it, and not before.

Filed by lane openRepoShape-3, from RV971's review of #971, its NIT-3 (comment 6254110331), on #971. Lane 3 ruled that NIT-3 goes to a follow-up issue and is not in #971's fix round.

State. Read at origin/main ae63d450. #971 (open, a draft; heads e40af32d and, after its fix round, 155fcd2d) does not touch these lines.

  • _credential_helper_configured() (setup-project.py:1288-1301) is titled "Will ANYTHING answer git's credential question for github.com?" It runs git config --get-all for credential.https://github.com.helper and for credential.helper, and answers True when either holds any text. That is whether a helper is CONFIGURED. It never asks whether a login is in it.
  • _check_credential_helper (:1304-1340) leaves a machine with a helper alone, and its docstring says why (:1312-1318): "osxkeychain, Windows' manager, store, a devcontainer's own: they all answer git's question for github.com without gh being involved ... A helper that is not gh's still pushes." The warning (:1333) and the offer of gh auth setup-git are for a machine with NO helper only.
  • tests/test_setup_project_py.py:1539 (test_a_credential_helper_that_is_not_ghs_is_left_alone) holds "left alone" and repeats the sentence in its docstring (:1541-1544).

What happens. Measured at ae63d450, with a scratch HOME, GIT_CONFIG_NOSYSTEM=1, GIT_CONFIG_GLOBAL a file holding credential.helper = store, and an EMPTY ~/.git-credentials. No network is asked: a helper that holds nothing answers nothing, and with the terminal prompt off git has no way to ask.

_credential_helper_configured(), no helper at all:       False   -> the check warns and offers `gh auth setup-git`
_credential_helper_configured(), helper=store, empty:    True    -> the check says nothing

printf 'protocol=https\nhost=github.com\n\n' | GIT_TERMINAL_PROMPT=0 git credential fill
fatal: could not read Username for 'https://github.com': terminal prompts disabled          exit 128

So "answers git's question" is false of store while nothing is stored, and so is "still pushes". It does not bite at main: a first scaffold's push in a terminal asks once, and RV971 measured it succeeding there (on main git asked once, all three pushed, exit 0, and the credential was stored). It bites once #971 lands, which runs every push with git's terminal prompt off: RV971 measured the same machine (store over an empty file) at #971's e40af32d as exit 2, could not read Username ... terminal prompts disabled, all three repositories left empty. At 155fcd2d that refusal now names the fix (_login_remedy, scaffold-project.py:1684), but only AFTER the repositories exist. Setup's check could have said it before anything exists, and says the opposite.

Evidence.

Direction.

Verify.

  • grep -n "they all answer git's question" setup-project.py tests/test_setup_project_py.py finds nothing, and the new wording says a store helper answers only with a login stored.
  • If the check is extended: a machine with credential.helper=store and a credentials file that is empty or absent gets the [??] and the offer, one with a github.com line in it gets nothing, --preflight exits 0 either way, and a dry run warns and offers nothing. Rows beside test_the_credential_helper_is_a_warning_not_a_refusal (tests/test_setup_project_py.py:1520), and test_a_credential_helper_that_is_not_ghs_is_left_alone changed to say what it holds.
  • tests/test_setup_project_py.py -k "credential", then the file; run one file at a time under a stub gh.

Size: S.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. added this to the v1.2.0 milestone on Oct 19, 2026
  2. brettheap commented on Oct 19, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-10-19T15:48:13Z, for #992

    Logged in lanes/log/openRepoShape-3.md at dfa035f53e1738d14369f7a8f1a9b06de1889949.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#992:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#992"`, kept where the row or its body names `#992`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `992` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions