You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Marcel Kapfer 1490024510
Added Gitignore for Python
2 years ago
.gitignore Added Gitignore for Python 2 years ago
LICENSE Added LICENSE 2 years ago Added README 2 years ago Renamed files according to Python guidelines 2 years ago Script for retrieving changelog between last two tags 2 years ago Renamed files according to Python guidelines 2 years ago

Changelog Tools


Our (@SvenPatrick and my) fundamental idea is to create the changelog for a GitLab release automatically after pushing a Git tag using a GitLab CI pipeline (see also the uulmhack/pipelines/auto-create-release project). The original implementation is/was based on the following simple one line shell command:

git diff --unified=0 HEAD~1 ./ | tail -n +6 | sed -e "s/^+//"

This relies on the fact, that the file was touched in the last commit before tagging and does not handle multiple changed blocks well. The tools in this project try to provide a more general solution for this.

The (initial) Python implementation is only made as a proof-of-concept and as of now works for the tests I have run. The next, intermediate tasks for this would include (automatic) tests. In the long run the goal would be a merge request into the gitlab-org/release-cli project which would require a rewrite using the Go programming language.


The project currently consists of three scripts whereby can be seen as the main entry point. Nevertheless it is possible to run all three scripts on its own and also the do not have any dependencies besides itself and modules of the standard library. It is of course required to execute the files while being in a Git repository.

The returns a chronologically sorted list of templates in the current Git repository. takes two arguments specifying the old and the newer revision to diff between and an optional third argument to the file to diff (this defaults to The script returns the changes lines from the file between the two given revisions. Thereby the diff is filtered to exclude single line changes since it is assumed that these only contain typo fixes or other not noteworthy changes.

The finally combines the two scripts to output the relevant part of the changelog between the last two tags in the current Git repository.