{"id":19666969,"url":"https://github.com/rednaks/git-hook-commit-ref","last_synced_at":"2025-10-12T16:06:18.592Z","repository":{"id":60994492,"uuid":"542773970","full_name":"rednaks/git-hook-commit-ref","owner":"rednaks","description":"git hook to add a reference to your commit message","archived":false,"fork":false,"pushed_at":"2023-05-26T11:42:04.000Z","size":35,"stargazers_count":7,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T16:04:12.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/git-hook-commit-ref","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rednaks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-28T20:08:44.000Z","updated_at":"2023-05-27T17:33:27.000Z","dependencies_parsed_at":"2024-11-11T16:43:35.461Z","dependency_job_id":null,"html_url":"https://github.com/rednaks/git-hook-commit-ref","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"c140b12eea9952a92ecc55cfaec1a96a02af7f11"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rednaks/git-hook-commit-ref","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednaks%2Fgit-hook-commit-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednaks%2Fgit-hook-commit-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednaks%2Fgit-hook-commit-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednaks%2Fgit-hook-commit-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rednaks","download_url":"https://codeload.github.com/rednaks/git-hook-commit-ref/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednaks%2Fgit-hook-commit-ref/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011983,"owners_count":26085039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T16:29:53.843Z","updated_at":"2025-10-12T16:06:18.559Z","avatar_url":"https://github.com/rednaks.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\nGit hook to prepare commit message.\n\nWill check if you're allowed to commit or not, if you're allowed to commit, check if there is a reference that matches the branch\nif not it will update the commit message.\n\n# How to use\n\nbuild the project:\n```\ncargo install git-hook-commit-ref\n```\n\n# Install the hook to your current git repo:\n```sh\ncd my_git_project\ngit hook-commit-ref --install\n```\n## Configure your git repo\n\nin your project, edit the `.git/config` file to add the organization and the project name, and a list of forbidden branches to commit from.\n\neg:\n\n```\n[commit-ref-hook]\n  org = \"rednaks\"\n  project = \"git-hook-commit-ref\"\n  forbiddenbranches = \"master, release\"\n  branchpattern = \"(?P\u003corg\u003e\\w+).*-(?P\u003cissue_number\u003e\\d+).*\"\n```\n\n## Branch name\nthe default branch name should match the `\u003corg\u003e-\u003cissue_number\u003e` pattern, but if your branch name is different, make sure to add the regex matching your branch name.\ndon't forget to add `org` and `issue_number` to capture the matches.\n\n`org` is optional, but `issue_number` is required.\n\n### Check everything is good\nTo check that everything works and configured, you can use `git hook-commit-ref --check` in your git repo.\n\n\n### Bypassing hook\nIn some situations like merging or rebasing there is no current branch, but a reference instead. you won't be able to commit your changes because it doesn't match the hook's configuration.\nYou can use `COMMIT_HOOK_IGNORE=true` env var when commit to bypass the hook.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednaks%2Fgit-hook-commit-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frednaks%2Fgit-hook-commit-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednaks%2Fgit-hook-commit-ref/lists"}