Simple python script to generate debian changelog file from git commits history
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Benjamin Renard 766e53c291
All checks were successful
Run tests / test-precommit (push) Successful in 1m42s
Upgrade README.md file
2026-07-31 16:28:53 +02:00
.forgejo/workflows Switch to nfpm to build Debian package 2026-07-31 16:17:41 +02:00
.chglog.yml Switch to nfpm to build Debian package 2026-07-31 16:17:41 +02:00
.gitignore Upgrade pre-commit hooks 2026-07-31 16:23:05 +02:00
.pre-commit-config.yaml Upgrade pre-commit hooks 2026-07-31 16:23:05 +02:00
.pylintrc Restore compatibility with python 3.5 2022-11-24 11:09:41 +01:00
.yamllint.yml Introduce pre-commit hooks 2024-03-15 08:52:56 +01:00
gitdch Upgrade pre-commit hooks 2026-07-31 16:23:05 +02:00
nfpm.yaml Switch to nfpm to build Debian package 2026-07-31 16:17:41 +02:00
README.md Upgrade README.md file 2026-07-31 16:28:53 +02:00
requirements.txt Upgrade pre-commit hooks 2026-07-31 16:23:05 +02:00

gitdch

Simple python script using GitPython library to generate debian changelog file from git commit history. Each existing tags is considered as a release version and current working version is numbered using ''git describe --always --tags'' command.

Installation

Dependencies

apt install git python3-git

Using git

git clone https://gitea.zionetrix.net/bn8/gitdch.git /usr/local/src/gitdch
ln -s /usr/local/src/gitdch/gitdch /usr/local/bin/gitdch

Using wget

wget -O /usr/local/bin/gitdch https://gitea.zionetrix.net/bn8/gitdch/raw/master/gitdch
chmod +x /usr/local/bin/gitdch

Using curl

curl -o /usr/local/bin/gitdch https://gitea.zionetrix.net/bn8/gitdch/raw/master/gitdch
chmod +x /usr/local/bin/gitdch

Usage

usage: gitdch [-h] [-d] [-v] [-w] [-l LOG_FILE] [-q] [-p PATH] [-o OUTPUT] [-A]
              [-n PACKAGE_NAME] [-V VERSION] [--version-suffix VERSION_SUFFIX]
              [-c CODE_NAME] [-u URGENCY] [-N MAINTAINER_NAME]
              [-E MAINTAINER_EMAIL] [-R RELEASE_NOTES] [--revision REVISION]
              [-C CLEAN_TAGS_REGEX] [-x EXCLUDE]

Generate Debian package changelog from git (version: dev)

options:
  -h, --help            show this help message and exit
  -d, --debug           Show debug messages
  -v, --verbose         Show verbose messages
  -w, --warning         Show warning messages
  -l, --log-file LOG_FILE
                        Log file path
  -q, --quiet           Quiet mode: do not log on console (only if log file is
                        provided)
  -p, --path PATH       Git repository path (default: ./)
  -o, --output OUTPUT   Generated Debian changelog output path (default: stdout)
  -A, --append          Append mode: if the output changelog file already exists,
                        append generated changelog lines at the beginning of the
                        file (optional, default: overwriting the file)
  -n, --package-name PACKAGE_NAME
                        Package name
  -V, --version VERSION
                        Current version (default: autodetected using git describe
                        --always --tags)
  --version-suffix VERSION_SUFFIX
                        Suffix for autodetected version
  -c, --code-name CODE_NAME
                        Debian code name (default: unstable)
  -u, --urgency URGENCY
                        Package urgency (default: medium)
  -N, --maintainer-name MAINTAINER_NAME
                        Maintainer name (default: last commit author name)
  -E, --maintainer-email MAINTAINER_EMAIL
                        Maintainer email (default: last commit author email)
  -R, --release-notes RELEASE_NOTES
                        Specify an optional Markdown release notes output path
  --revision REVISION   Specify the revision to use to generate the changelog (see
                        git-rev-parse for viable options, optional, default:
                        generate the changelog with all commits of the current
                        branch)
  -C, --clean-tags-regex CLEAN_TAGS_REGEX
                        Clean tags regex: you could specify regex to clean tag
                        names when computing package versions. For instance, to
                        drop a "-eeXXX" suffix of tag names, specify -C
                        "\-ee[0-9]{3}$" (optional, multiple regex allowed)
  -x, --exclude EXCLUDE
                        Commit exclusion regex: you could specify regex to exclude
                        some commits from generated changelog entries. For
                        instance, to exclude commits with message starting with
                        "CI: ", specify -x "^CI: " (optional, multiple regex
                        allowed)

Copyright (c) 2013-2022 Benjamin Renard brenard@zionetrix.net

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.