Crates.io | pkgcruft-git |
lib.rs | pkgcruft-git |
version | 0.0.3 |
created_at | 2025-07-27 20:16:31.718903+00 |
updated_at | 2025-09-13 21:42:30.946726+00 |
description | QA support for verifying git commits via pkgcruft |
homepage | https://github.com/pkgcraft/pkgcraft/tree/main/crates/pkgcruft-git |
repository | https://github.com/pkgcraft/pkgcraft/tree/main/crates/pkgcruft-git |
max_upload_size | |
id | 1770383 |
size | 178,456 |
QA support for verifying git commits via pkgcruft.
Build and install from git:
cargo install pkgcruft-git --git https://github.com/pkgcraft/pkgcraft.git
To perform commit verification locally before pushing to a remote, symlink the pkgcruft-git-pre-push binary as a pre-push hook for the target git repo:
cd path/to/git/repo
mkdir -p .git/hooks
ln -s $(which pkgcruft-git-pre-push) .git/hooks/pre-push
When using multiple pre-push hooks, it will have to be called manually passing the expected remote arguments.
To start a service demo, run the following script:
./examples/pkgcruft-gitd
This will build the required pkgcraft tooling and initialize the files
necessary to run the service in the examples/demo
directory. By default it
uses the gentoo repo from github, but should work if pointed at any accessible,
remote git URL for a standalone ebuild repo.
The script creates three git repos under the examples/demo
directory. The
client.git
repo is what users should interact with, creating commits and
using git push
that pushes them to the remote.git
repo. The remote repo is
configured to trigger pkgcruft scanning runs via a pre-receive hook targeting
the changes made in the commits.
Once the repos are set up, the script ends by starting the pkgcruft-gitd
service that runs against the server.git
repo. The service can be stopped via
SIGINT and restarted by re-execing the script.
To reset the demo entirely, recursively remove the examples/demo directory before running the script.