Skip to content

Name the URL and cache env var in the no-credentials error - #76

Merged
gaborcsardi merged 2 commits into
r-lib:mainfrom
SokolovAnatoliy:pr1-no-credentials-message
Sep 24, 2026
Merged

gaborcsardi merged 2 commits into
r-lib:mainfrom
SokolovAnatoliy:pr1-no-credentials-message

Conversation

@SokolovAnatoliy

Copy link
Copy Markdown
Contributor

The gitcreds_no_credentials condition already carries url, but the message doesn't use it:

Error: Could not find any credentials

So a user who needs to set the environment variable has no way to learn its name at the moment
they need it. That is the confusion reported in #56. Proposed message:

Error: Could not find any credentials for 'https://codeberg.org'.
Run `gitcreds_set("https://codeberg.org")`, or set the
`GITHUB_PAT_CODEBERG_ORG` environment variable.

No behavior change and no new dependency. This is independent of the rename discussed in #56 and
worth having whichever way that goes.

Refs #56

The gitcreds_no_credentials condition already carries the url, but the
message did not use it, so a user who needs to set the env var has no
way to learn its name at the moment they need it.

Falls back to the bare message when the URL cannot be parsed, so the
raw gitcreds_parse_output() API still reports a missing credential
rather than a parse error.

Refs r-lib#56
@gaborcsardi
gaborcsardi merged commit 79e5b6f into r-lib:main Sep 24, 2026
15 checks passed
@gaborcsardi

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants