Skip to content

Conversation

@shaanmajid
Copy link
Contributor

@shaanmajid shaanmajid commented Jan 24, 2026

Changes:

  • Adds GIT_CONFIG_PARAMETERS to the environment variable allowlist, enabling URL rewriting for private repository authentication in CI environments.
  • Adds information to FAQs about configuring private repository authentication.

Closes #1377

@codecov
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

❌ Patch coverage is 71.25749% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.87%. Comparing base (ca1d4b5) to head (17f903b).

Files with missing lines Patch % Lines
crates/prek/src/git.rs 66.33% 34 Missing ⚠️
crates/prek/src/workspace.rs 77.14% 8 Missing ⚠️
crates/prek/src/cli/try_repo.rs 77.77% 4 Missing ⚠️
crates/prek/src/process.rs 87.50% 1 Missing ⚠️
crates/prek/src/store.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1472      +/-   ##
==========================================
- Coverage   91.05%   90.87%   -0.19%     
==========================================
  Files          87       87              
  Lines       18367    18529     +162     
==========================================
+ Hits        16724    16838     +114     
- Misses       1643     1691      +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Jan 24, 2026

📦 Cargo Bloat Comparison

Binary size change: +0.00% (22.8 MiB → 22.8 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text    Size        Crate Name
 0.3%   0.8% 72.2KiB        prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7% 61.5KiB         prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.2%   0.6% 56.4KiB         prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.2%   0.5% 46.3KiB         prek prek::run::{{closure}}
 0.2%   0.5% 43.8KiB         prek prek::cli::run::run::run::{{closure}}
 0.2%   0.5% 42.8KiB         prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5% 42.7KiB         prek prek::identify::by_extension::{{closure}}
 0.1%   0.3% 32.0KiB        prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.1%   0.3% 30.0KiB  serde_json? <&mut serde_json::de::Deserializer<R> as serde_core::de::Deserializer>::deserialize_struct
 0.1%   0.2% 22.2KiB         prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 22.0KiB         prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 21.5KiB         prek prek::archive::unzip::{{closure}}
 0.1%   0.2% 21.3KiB clap_builder clap_builder::parser::parser::Parser::get_matches_with
 0.1%   0.2% 20.0KiB         prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.6KiB         prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.6KiB         prek <prek::languages::ruby::ruby::Ruby as prek::languages::LanguageImpl>::install::{{closure}}
 0.1%   0.2% 18.8KiB         prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.2% 18.8KiB         prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.2% 18.8KiB         prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.2% 18.6KiB         ring ring_core_0_17_14__x25519_ge_frombytes_vartime
36.9%  91.5%  8.4MiB              And 20101 smaller methods. Use -n N to show more.
40.3% 100.0%  9.2MiB              .text section size, the file size is 22.8MiB

Base Branch Results

 File  .text    Size        Crate Name
 0.3%   0.8% 72.2KiB        prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7% 61.5KiB         prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.2%   0.6% 56.4KiB         prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.2%   0.5% 46.3KiB         prek prek::run::{{closure}}
 0.2%   0.5% 43.8KiB         prek prek::cli::run::run::run::{{closure}}
 0.2%   0.5% 42.8KiB         prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5% 42.7KiB         prek prek::identify::by_extension::{{closure}}
 0.1%   0.3% 32.0KiB        prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.1%   0.3% 30.0KiB  serde_json? <&mut serde_json::de::Deserializer<R> as serde_core::de::Deserializer>::deserialize_struct
 0.1%   0.2% 22.2KiB         prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 22.0KiB         prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 21.5KiB         prek prek::archive::unzip::{{closure}}
 0.1%   0.2% 21.3KiB clap_builder clap_builder::parser::parser::Parser::get_matches_with
 0.1%   0.2% 20.0KiB         prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.6KiB         prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.6KiB         prek <prek::languages::ruby::ruby::Ruby as prek::languages::LanguageImpl>::install::{{closure}}
 0.1%   0.2% 18.8KiB         prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.2% 18.8KiB         prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.2% 18.8KiB         prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.2% 18.6KiB         ring ring_core_0_17_14__x25519_ge_frombytes_vartime
36.9%  91.5%  8.4MiB              And 20101 smaller methods. Use -n N to show more.
40.3% 100.0%  9.2MiB              .text section size, the file size is 22.8MiB

@shaanmajid shaanmajid force-pushed the feat/private-repo-auth branch 6 times, most recently from 7f9684c to 548a595 Compare January 26, 2026 16:52
Allow GIT_CONFIG_PARAMETERS to pass through to git commands, enabling
users to configure credentials for private repositories via environment
variables.

Closes j178#1377
@shaanmajid shaanmajid force-pushed the feat/private-repo-auth branch 2 times, most recently from cf06b5b to 77d9340 Compare January 26, 2026 17:43
Document how to authenticate with private hook repositories:
- Credential helpers (gh CLI, osxkeychain, Git Credential Manager)
- SSH URLs with agent
- URL rewriting with tokens for CI
@shaanmajid shaanmajid force-pushed the feat/private-repo-auth branch 2 times, most recently from b6ff984 to 17f903b Compare January 26, 2026 20:00
@shaanmajid
Copy link
Contributor Author

shaanmajid commented Jan 27, 2026

@j178 Most of the code changes in this PR are from adding hint messages in feat: show auth hints for private repo errors, but the main functional change is in feat(git): add GIT_CONFIG_PARAMETERS to env var allowlist. Let me know if you disagree with the former and I can drop that commit; it got a bit messy as I tried to add the error messages to both prek install and prek try-repo

@shaanmajid shaanmajid changed the title Feat/private repo auth Allow GIT_CONFIG_PARAMETERS for private repository authentication Jan 27, 2026
@shaanmajid shaanmajid marked this pull request as ready for review January 27, 2026 01:19
@j178
Copy link
Owner

j178 commented Jan 27, 2026

Thanks! The FAQ part looks great. About that last commit (17f903b), it feels a bit more complicated than I expected, so I might hold off on including it for now.

@shaanmajid shaanmajid force-pushed the feat/private-repo-auth branch from 17f903b to 5b9003a Compare January 27, 2026 19:06
@shaanmajid
Copy link
Contributor Author

Dropped the last commit.

@j178 j178 merged commit f0d96ec into j178:master Jan 28, 2026
22 checks passed
@shaanmajid shaanmajid deleted the feat/private-repo-auth branch January 28, 2026 05:02
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.

Enable cloning hooks from a private repository

2 participants