Skip to content

[Feature suggestion] Extend commit-msg with auto jira ticket number prefix #875

Description

@NikitaNazarov1

Hi there!

Many large teams use project management tools such as Jira/Trello/etc., along with standardized branch and commit naming conventions.
For example most common branch naming pattern looks like:

  • $type/$PRJ-$NNN/$ticket_description
    Where:
  • $type – ticket type (e.g., task, bug, hotfix, typo)
  • $PRJ-$NNN – ticket identifier (e.g., PROJ-1234)
  • $ticket_description – short description

Example branch names:

  • task/XXX-8765/change_registration_form
  • bug/XXX-9012/fix_reimport_worker
  • typo/XXX-1234/fix_notification_message_wording
  • hotfix/XXX-5678/fix_latest_data_migration

Similarly, commit messages often follow a required format:

  • [$PRJ-$NNN] Short commit description

It can be automated via a commit-msg git hook.So, if the branch name contains a ticket identifier (e.g., task/XXX-1234/fix-bug), the hook can automatically prepend [XXX-1234] to the commit message unless it's already present.

I've already implemented this behavior in my gem:

If you think this would be useful here, I'd be happy to open a PR adding similar functionality to overcommit.

Looking forward to your thoughts 🙂

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions