Commity is a script that print the commits from a git branch in a user-friendly way using Markdown format, inspired from default pull-requests templates in BitBucket.
You need Python 3.7 to execute this script.
Here is the command to install all necessary packages:
With pip:
pip install --no-cache-dir -r requirements.txtWith conda (and its environment):
conda install --name myenv -c conda-forge --file requirements.txtTo install this script, you first need to clone this project, and
then execute commity.py.
To execute Commity, you might need to specify some arguments:
-ror--repo: The path to the git directory. By default, the current folder is taken.-bor--branch: The name of the branch where to get the commits. By default, the current branch is taken.-ior--issue: If given, the first line will contain all the issues that have been marked as "fixed" in the commits messages of the given branch.
Example:
python commity.py -r C:\Users\Foo\MyProject -b feat/gui-buttons -i
It is possible to run commity from the given Dockerfile.
To execute commity using docker, please refer to the example below:
With Makefile:
cd path/to/commity
make docker-build
docker run -it -v "C:\Users\Foo\myproject:/myproject" cynnexis/commity run -r /myproject -b master --issueWithout Makefile:
cd path/to/commity
docker build -t cynnexis/commity .
docker run -it -v "C:\Users\Foo\myproject:/myproject" cynnexis/commity run -r /myproject -b master --issueIf your using bash, you can setup an alias to call commity:
First, let's create a conda environment if you have not done iet yet:
cd path/to/commity
conda create --name commity python=3.7.6
conda install --name commity -c conda-forge --file requirements.txtThen, activate the environment:
conda activate commityGet the path to your Python environment:
which pythonFor this tutorial, let's assume the path is /home/user/anaconda3/envs/commity/bin/python. Create an alias with the
following command:
echo alias commity="/home/user/anaconda3/envs/commity/bin/python /absolute/path/to/commity/commity.py" >> ~/.bash_aliasesAnd it's ready! To get all the commits messages of a local repository, go to your project folder, and execute the
commity command such as:
commity -iThe command will assume the current working directory is the repository, and will analyze the current branch. The
fixed issues will be printed with the -i option.
Contribution are not permitted yet, because this project is really simple and should not be a real problem. You noticed a bug in the script or in the source code? Feel free to post an issue about it.
- Valentin Berger (Cynnexis): developer
This project is under the GNU Affero General Public License v3.0. Please see the LICENSE.txt file for more detail (it's a really fascinating story written in there!)
- Git team ; what a flawless system they created!