Skip to content

Use git cat-file -e in check if a rev exists#1277

Merged
j178 merged 1 commit intomasterfrom
rev-exist
Dec 25, 2025
Merged

Use git cat-file -e in check if a rev exists#1277
j178 merged 1 commit intomasterfrom
rev-exist

Conversation

@j178
Copy link
Owner

@j178 j178 commented Dec 25, 2025

No description provided.

@j178 j178 added the performance Performance improvements label Dec 25, 2025
@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.98%. Comparing base (28df874) to head (7f0ff75).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
crates/prek/src/git.rs 0.00% 3 Missing ⚠️
crates/prek/src/cli/hook_impl.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1277      +/-   ##
==========================================
- Coverage   89.99%   89.98%   -0.01%     
==========================================
  Files          80       80              
  Lines       15753    15753              
==========================================
- Hits        14177    14176       -1     
- Misses       1576     1577       +1     

☔ 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.

@j178 j178 changed the title Use git cat-file -e in to check rev exist Use git cat-file -e in check if rev exist Dec 25, 2025
@j178 j178 changed the title Use git cat-file -e in check if rev exist Use git cat-file -e in check if a rev exists Dec 25, 2025
@github-actions
Copy link

📦 Cargo Bloat Comparison

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

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size          Crate Name
 0.6%   1.4% 107.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.3% 107.2KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.7%  54.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  52.8KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  39.8KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.2KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  39.2KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
 0.2%   0.5%  36.9KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.5%  36.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.7KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  29.8KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  27.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  26.2KiB           prek prek::cli::auto_update::update_repo::{{closure}}
 0.2%   0.3%  25.7KiB           prek prek::cli::run::run::run_hooks::{{closure}}
 0.1%   0.3%  25.3KiB           prek prek::main
 0.1%   0.3%  24.4KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
41.2%  88.6%   6.9MiB                And 10642 smaller methods. Use -n N to show more.
46.5% 100.0%   7.8MiB                .text section size, the file size is 16.7MiB

Base Branch Results

 File  .text     Size          Crate Name
 0.6%   1.4% 107.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.3% 107.2KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.7%  54.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  52.8KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  39.8KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.2KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  39.2KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
 0.2%   0.5%  36.9KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.5%  36.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.7KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  29.8KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  27.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  26.2KiB           prek prek::cli::auto_update::update_repo::{{closure}}
 0.2%   0.3%  25.7KiB           prek prek::cli::run::run::run_hooks::{{closure}}
 0.1%   0.3%  25.3KiB           prek prek::main
 0.1%   0.3%  24.4KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
41.2%  88.6%   6.9MiB                And 10642 smaller methods. Use -n N to show more.
46.5% 100.0%   7.8MiB                .text section size, the file size is 16.7MiB

@j178
Copy link
Owner Author

j178 commented Dec 25, 2025

Hey @ptarjan, I borrowed your optimization from pre-commit here. Thanks for the tweak—hope you don’t mind!

@j178 j178 merged commit f010247 into master Dec 25, 2025
22 checks passed
@j178 j178 deleted the rev-exist branch December 25, 2025 03:01
@ptarjan
Copy link

ptarjan commented Dec 25, 2025

Nice, thanks! You're welcome to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants