Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/milin/giticket
Browse files Browse the repository at this point in the history
  • Loading branch information
milind-shakya-sp committed Jan 2, 2019
2 parents a27b751 + 0da442c commit 1fa4ee2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
29 changes: 17 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,28 @@ Auto add ticket info to your git commits.
Features
--------

It integrates with [pre-commit](https://pre-commit.com/)
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.
- The branch name format must be <ticket number>_<rest of the branch name>

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=<custom regex>]`` in your .yaml file if you have custom ticket regex.
By default its ``[A-Z]+-\d+``.

It is best used along with pre-commit_.

The following is a sample commit.

```
::

repos:
- repo: https://github.com/milin/giticket
- repo: https://github.com/milin/giticket
rev: 'master'
hooks:
- id: giticket
```


Credits
-------
- id: giticket
args: ['--regex=PROJ-[0-9]'] # Optional

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _pre-commit: https://pre-commit.com/
1 change: 0 additions & 1 deletion giticket/giticket.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals

Expand Down

0 comments on commit 1fa4ee2

Please sign in to comment.