Vendored git-auth.R will need a re-vendor if gitcreds renames the cache env var
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- git, r
- Domain
- authentication, tooling
Research direction
Start with the vendored copy in R/git-auth.R, especially line 219 and git_creds_for_url(), then check the referenced gitcreds pull requests for the final cache-variable naming. Done means re-vending the file when the upstream change lands and preserving the documented FAIL-sentinel behavior between the copies.
Written by the indexing model from the issue text.
Description
R/git-auth.R is a vendored copy of the gitcreds standalone file. Line 219 computes the cache
environment variable name:
paste0("GITHUB_PAT_", toupper(slug3))
There are open PRs on gitcreds to move that prefix to GITCREDS_PAT_: r-lib/gitcreds#76, r-lib/gitcreds#77 and r-lib/gitcreds#78, for r-lib/gitcreds#56. Filing here so the re-vendor is on the radar.
One specific to pkgdepends: git_creds_for_url() writes "FAIL" to the computed name as a
negative cache, and gitcreds honors that sentinel by throwing before it asks git. So the variable
is a channel between the two copies, not just a user-facing string. r-lib/gitcreds#77 deliberately scopes
the sentinel to the canonical name, because honoring it under legacy names too would let a
FAIL written here suppress a credential that is present:
library(gitcreds)
cfg <- tempfile()
writeLines(c(
"[credential]",
"\thelper = \"!f() { test \\\"$1\\\" = get && echo username=demo-user && echo password=real-token; }; f\""
), cfg)
url <- "https://gitlab.example.com"
ev <- gitcreds_cache_envvar(url) #> "GITHUB_PAT_GITLAB_EXAMPLE_COM"
withr::with_envvar(c(GIT_CONFIG_GLOBAL = cfg, GIT_CONFIG_NOSYSTEM = "1"), {
gitcreds_get(url, use_cache = FALSE, set_cache = FALSE)$username
#> [1] "demo-user" # the store has a good credential
withr::with_envvar(structure(list("FAIL"), names = ev), gitcreds_get(url))
#> Error: Could not find any credentials
})
Worth noting that pak ships pkgdepends in a pinned private library, so the skew between the two
copies outlives a gitcreds upgrade in the user's own library.
- Dominant language
- C
- Stars
- 135
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/pkgdepends
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 4 comments ·
-
Allow trailing slash(es) in urls?Possibly taken @BjarkeHautop claimed this 90 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
r-lib/pkgdepends#477 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
r-lib/pkgdepends#486 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
r-lib/pkgdepends#483 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
r-lib/pkgdepends#471 · 10 comments · 1 reaction ·
All issues in r-lib/pkgdepends
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
CVE-2026-111497Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
fink/fink-distributions#1322 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
openvehicles/Open-Vehicle-Monitoring-System-3#1563 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ONLYOFFICE/DesktopEditors#2533 ·