A personal set of git hooks to automate mundane tasks.
If you are using Git 2.9
you can clone this repository, set your core.hooksPath
variable and you'll be
good to go:
mkdir --parents "${HOME}/.config/git"
git config --global core.hooksPath "${HOME}/.config/git/hooks"
git clone https://github.com/AlexandreCarlton/git-hooks.git "${HOME}/.config/git/hooks"
If you aren't using a new enough version of Git, you'll have to clone this repository into your templates directory, which will be copied into every git repository you create. The downside of this is that you will have to manually update each repository's hooks when you update this one.
mkdir --parents "${HOME}/.config/git/templates"
git config --global init.templatedir "${HOME}/.config/git/templates"
git clone https://github.com/AlexandreCarlton/git-hooks.git "${HOME}/.config/git/templates/hooks"
If you would like to use these hooks in existing repositories, you will have to
call git init
in every single one, which will copy the template directory
across into each .git
folder.
These are called by our git hooks.
Deletes any .pyc
, .pyo
and __pycache__
files found in the project to
force recompilation of .py
files on a checkout.
"Adapted" from Effortless Ctags with Git, this script will create a tags file from all tracked files in the repository.
Attempts to determine the ticket number of a JIRA issue from the current branch name (generated by Bitbucket Server) and substitutes it into a special expression in the message template if present.
The syntax is:
{{.*TICKET.*}}
where characters before and after 'TICKET' are preserved.
For example, {{[TICKET] }}
for ISSUE-123
would translate to [ISSUE-123]
.
If no ticket can be extracted, the expressions are removed.