Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/milin/giticket
Utility to autoadd ticket number specified in your branch name to your commits!
https://github.com/milin/giticket
agile commits git jira precommit tickets
Last synced: about 1 month ago
JSON representation
Utility to autoadd ticket number specified in your branch name to your commits!
- Host: GitHub
- URL: https://github.com/milin/giticket
- Owner: milin
- License: mit
- Created: 2019-01-02T19:12:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-30T08:30:42.000Z (about 1 year ago)
- Last Synced: 2024-10-02T19:38:01.801Z (2 months ago)
- Topics: agile, commits, git, jira, precommit, tickets
- Language: Python
- Homepage:
- Size: 69.3 KB
- Stars: 78
- Watchers: 2
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - milin/giticket - Utility to autoadd ticket number specified in your branch name to your commits! (git)
README
========
giticket
========.. image:: https://api.star-history.com/svg?repos=milin/giticket&type=Date)](https://star-history.com/#milin/giticket&Date
.. image:: https://img.shields.io/pypi/v/giticket.svg
:target: https://pypi.python.org/pypi/giticket.. image:: https://travis-ci.com/milin/giticket.svg?branch=master
:target: https://travis-ci.org/milin/giticket.. image:: https://readthedocs.org/projects/giticket/badge/?version=latest
:target: https://giticket.readthedocs.io/en/latest/?badge=latest
:alt: Documentation StatusAuto add ticket info to your git commits.
* Free software: MIT license
* Documentation: https://giticket.readthedocs.io.Features
--------This hook saves developers time by prepending ticket numbers to commit-msgs.
For this to work the following two conditions must be met:
- The ticket format regex specified must match, if the regex is passed in.
- Unless you use ``regex_match`` mode, the branch name format must be _For e.g. if you name your branch ``JIRA-1234_awesome_feature`` and commit ``Fix some bug``, the commit will be updated to ``JIRA-1234 Fix some bug``.
Pass ``--regex=`` or update ``args: [--regex=]`` in your .yaml file if you have custom ticket regex.
By default it's ``[A-Z]+-\d+``.Pass ``--format=`` or update ``args: [--format=]`` in your .yaml file if you have custom message replacement.
By default it's ``'{ticket} {commit_msg}``, where ``ticket`` is replaced with the found ticket number and ``commit_msg`` is replaced with the original commit message.Pass ``--mode=`` or update ``args: [--mode=regex_match]`` in your .yaml file to extract ticket by the regex rather than relying on branch name convention.
With this mode you can also make use of ``{tickets}`` placeholder in ``format`` argument value to put multiple comma-separated tickets in the commit message in case your branch contains more than one ticket.It is best used along with pre-commit_. You can use it along with pre-commit by adding the following hook in your ``.pre-commit-config.yaml`` file.
::
repos:
- repo: https://github.com/milin/giticket
rev: v1.3
hooks:
- id: giticket
args: ['--regex=PROJ-[0-9]', '--format={ticket} {commit_msg}'] # OptionalYou need to have precommit setup to use this hook.
--------------------------------------------------
Install Pre-commit and the commit-msg hook-type.::
pip install pre-commit
pre-commit install
pre-commit install --hook-type commit-msg.. _pre-commit: https://pre-commit.com/