https://github.com/natserract/rust-git-hooks
🏄 Git hooks made easy with Rust
https://github.com/natserract/rust-git-hooks
async-await git git-hooks rust rust-lang
Last synced: about 2 months ago
JSON representation
🏄 Git hooks made easy with Rust
- Host: GitHub
- URL: https://github.com/natserract/rust-git-hooks
- Owner: natserract
- Created: 2019-12-21T22:22:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-22T15:56:55.000Z (over 6 years ago)
- Last Synced: 2025-04-04T07:34:16.943Z (about 1 year ago)
- Topics: async-await, git, git-hooks, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Git Hooks
Git hooks are scripts that Git executes before or after events such as: commit, push, and receive. Git hooks are a built-in feature - no need to download anything. Git hooks are run locally.
### How do git hooks work?
Every Git repository has a `.git/hooks` folder with a script for each hook you can bind to. You're free to change or update these scripts as necessary, and Git will execute them when those events occur.
Here's a full list of hooks you can attach scripts to: [git hooks lists](https://githooks.com/).
## Environments
- rust -> 1.0 (nightly channel)
- git2 -> "0.10"
- time -> "0.1"
- futures -> "0.3.1"
## Running
To try the hooks, do the following to compile the hooks and symlink them into your git hooks folder.
```sh
cargo run
```
And then you will see the output like this:
```sh
Last Commit:
Id -> ...
Message -> ...
Committer Name -> ...
Committer Email -> ...
Time -> ...
Raw -> "..."
Branch has been succesfully created! If you wanna check type command git branch -a
Branch has been succesfully renamed! If you wanna check type command git branch -a
Branch has been succesfully deleted! If you wanna check type command git branch -a
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.