{"id":16923755,"url":"https://github.com/robatwilliams/git-ticket-number-prefix-hook","last_synced_at":"2026-05-20T05:10:13.360Z","repository":{"id":73483580,"uuid":"109492195","full_name":"robatwilliams/git-ticket-number-prefix-hook","owner":"robatwilliams","description":"Automatically prefixes commit messages with ticket number from the branch name","archived":false,"fork":false,"pushed_at":"2019-10-29T21:04:02.000Z","size":13,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T00:31:34.343Z","etag":null,"topics":["git","git-hooks","jira"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/robatwilliams.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":"2017-11-04T12:16:07.000Z","updated_at":"2021-02-26T14:45:12.000Z","dependencies_parsed_at":"2023-02-28T04:46:29.216Z","dependency_job_id":null,"html_url":"https://github.com/robatwilliams/git-ticket-number-prefix-hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robatwilliams/git-ticket-number-prefix-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatwilliams%2Fgit-ticket-number-prefix-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatwilliams%2Fgit-ticket-number-prefix-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatwilliams%2Fgit-ticket-number-prefix-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatwilliams%2Fgit-ticket-number-prefix-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robatwilliams","download_url":"https://codeload.github.com/robatwilliams/git-ticket-number-prefix-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robatwilliams%2Fgit-ticket-number-prefix-hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273547468,"owners_count":25125069,"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-09-04T02:00:08.968Z","response_time":61,"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":["git","git-hooks","jira"],"created_at":"2024-10-13T20:00:30.005Z","updated_at":"2026-05-20T05:10:13.317Z","avatar_url":"https://github.com/robatwilliams.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git commit message ticket number prefix hook\r\nAutomatically prefixes commit messages with ticket number from the branch name.\r\n\r\nThe current regular expression suits the JIRA style of ticket number: `ABC-123`. Commits made to a branch whose name starts with that pattern will have their message prefixed.\r\n\r\nReview the unit tests to learn about other features and behaviour.\r\n\r\n## Shell and JavaScript variants\r\nJavaScript: easier for me to write, and hopefully easier for you to modify should you need to.\r\n\r\nShell (Bash): doesn't need Node.js, and ~10% faster.\r\n\r\n## Installation\r\nCopy `commit-msg` from `hooks/\u003cvariant\u003e` to the `.git/hooks` folder in your repository clone folder.\r\n\r\nYou may want to look up automated hook sharing approaches such as using the `core.hooksPath` configuration variable.\r\n\r\n## Tests\r\nThe hook is tested in a fixture Git repository. Tests are implemented and run using the [BATS](https://github.com/bats-core/bats-core/) framework; each one is a small shell script.\r\n\r\n```bash\r\n# Install BATS\r\ngit clone https://github.com/bats-core/bats-core.git\r\n\r\n# Run tests\r\n./test.sh\r\n./test.sh [variant]\r\n```\r\n\r\n## Want to go further?\r\n* [commitizen](https://github.com/commitizen/cz-cli)\r\n* [commitlint](https://github.com/marionebl/commitlint)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobatwilliams%2Fgit-ticket-number-prefix-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobatwilliams%2Fgit-ticket-number-prefix-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobatwilliams%2Fgit-ticket-number-prefix-hook/lists"}